Discussion:
problem with using labview pattern matching
(too old to reply)
EE_ga
2008-08-13 17:10:05 UTC
Permalink
I am currently creating a vi that would take an image of a target and take note of its coordinates, with the image of this target i will turn it into a template, from then on i will take an image of a live target and use pattern matching to find that target in the image to get the coordinates of it get the difference in position between the live target and the template and repeat this process untill all the targets we have are characterized. The way this works is that the first target (which will be my template) is attached to a post and i take pictures with 3 ieee cameras.  The post is placed on a micropositioner.  After the images of the target are taken i create 3 templates for pattern matching from each image taken with the three cameras.  After the template has been made, i remove the first target (and post it is attached to) and put a new target (attached to a different post) and take images with all three cameras again only this time with the images i will use pattern matching to find the target and its position.  After finding the position of the target i will find the difference in coordinates between the current target on the micropositioner and the templates coordinates.  All targets are roughly the same size and exact shape.  This process is done so we can allign a target in the same position in space everytime (especially since these targets are in the size of magnitude of micrometers). The problem i am having is with the pattern matching and viewing some of the images in my labview vi.Ive tried two things,First was to take an image using NI Vision and then do the pattern matching  in vision to create a template by selecting a region of interest.When creating that template in vision i would bring that file up in my labview vi and pass that file as the template when i call teh pattern matching vi.  To make things simple i'll just explain the vi with the use of only one camera (instead of three),In the vi i have two image windows on the front panel, one will hold the image of the template and the other window contains a live feed of the new target placed on the micropositioner.Once i tell the camera to take an image the vi then takes that newly aquired image uses pattern matching to find the position of the target. This process worked fine, the only problem i had was when bringing up the template and placing it in the image windows ont eh front panel, it did not display the whole image, rather it only displayed the region of interest of the rectangle i drew out.  The problem with this is that when referencing the template the user can't compare the current targets position on the screen with that of the template. The Second thing i tried was just creating a template using the learn pattern function in labview.  Here i did not have to draw out a region of interest and when bringing up the template in the vi i created, it shows the whole image which allows the user to compare the location of the template and the target through the live feed.  The problem with this however is that once i move the target around and try to do pattern matching labview cant recognize it unless it was in the exact spot.  I think the problem might be is when making the template without specifying a reigion of interest labview takes the whole image and thinks that is the pattern, so if the target i put onto the post is in a different postion on the screen labview will not find it. Is there a way for me to create a pattern and selecat a region of interest while at the same time keep the original size of the image when bringing up the template?
muks
2008-08-14 08:10:11 UTC
Permalink
First For your own good post pattern matching and image processing function related queiries  in the machine vision section to get a better hit rate. R u using a imaq extract function in your vi?This function when used without connecting imaq destination will make your image look smaller because of over wriiten buffer. So You have a master image and you want to chose a template everytime you run the vi? Is my understanding right?What is image type you are storing as your template?You can directly use vision assistant and set a proper score and orientation.Have you tried this? Can you post your vi or a screen shot of your block diagram?Message Edited by muks on 08-14-2008 03:09 AM
EE_ga
2008-08-14 21:10:04 UTC
Permalink
Hi thanks for the reply here is the image of the front panel. The first attachment is with a template with full screen and template made from a labview vi with no region of interest is drawn (im assuming vision takes the whole region of interest as everything the camera sees), pattern matching in this case does not work, but the exact image of what the camera sees is shown. The second is when the template is created with a selected region of interest, pattern matchin does work in the case but it does not show the whole picture of what the camera sees.


forum help1.rtf:
http://forums.ni.com/ni/attachments/ni/170/349450/1/forum help1.rtf


forum help2.rtf:
http://forums.ni.com/ni/attachments/ni/170/349450/2/forum help2.rtf
Loading...