03-16-2010 10:10 AM
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.
03-16-2010 11:16 PM
03-22-2010 08:43 AM
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
03-23-2010 08:56 AM
Hey Jeff,
Check out this article on Subpixel Accuracy in NI-Vision for some more information on how this subpixel accuracy is achieved.