LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Pattern matching without imaq

I'm trying to use pattern matching to find out where an X x Y element is located in a new image/array.  However I need to do this without the IMAQ Match Pattern 2.  For one, this needs to run on a Linux machine and unfortunately IMAQ is unavailable for this platform and two,  I need support support for higher bit depth images than 8-bit grayscale.  I read somewhere on the forum that 8-bits is the limit and found no other documentation that stated otherwise.  

 

So I have been cross-correlating the images and then searching the output array to find the maximum value and using that to determine the new placement of the X x Y element.  This is obviously not as robust as the Match Pattern 2 pre-built VI but unfortunately how that works is a mystery other than the documentation in chapter 12 of the Vision Concepts Manual, which takes me down the cross-correaltion path.  I assume this is what Match Pattern 2 is doing.

 

I'm wondering what else Pattern Match 2 is doing because when I process a couple of images with this Vi and keep "Subpixel Accuracy" false and wire an output to the Matches terminal, the x and y position values are not whole numbers, and still seem to be accurate.  When I run a cross-correlation, I get whole numbers as one would expect but at this point I can't verify that it actually works.  I'm assuming the maximum x and y values of the cross- correlation is the value of displaced pattern in the new image, this is what is indicated on page 12-7 of the Vison Maunual.  It seems to find the location of the X x Y element, but I can't verify it by comparing it with the Match Pattern 2 VI because so far the results are different.  This may be due to this seemingly subpixel accuracy in the Match Pattern 2 Vi whereas the cross-correlation is only giving me single pixel accuracy.

 

Can anyone give me some advice on creating a more robust pattern matching VI and maybe how this accuracy is achieved?  Unfortunately I can't use the prebuilt VI due to the 8-bit limitation as well as it being OS specific.

0 Kudos
Message 1 of 4
(2,983 Views)
Can you also post a few images?
0 Kudos
Message 2 of 4
(2,956 Views)

Actually, the images I'm using I found here on the forum while researching this topic.  They seemed like good examples to track a small portion of the image.  Specifically I am using step070.tif and step100.tif, as they showed the most movement.  Here's a link to the thread where I found them as well as a link to the images.  I saved them from rgb to grayscale before using them.

 

http://forums.ni.com/ni/board/message?board.id=200&thread.id=18706&view=by_date_ascending&page=2

 

http://forums.ni.com/ni/attachments/ni/200/19073/1/Tensile_Images.ZIP
0 Kudos
Message 3 of 4
(2,929 Views)

Hey Jeff,

 

Check out this article on Subpixel Accuracy in NI-Vision for some more information on how this subpixel accuracy is achieved.

Hope this helps.
-Ben

WaterlooLabs
0 Kudos
Message 4 of 4
(2,903 Views)