08-18-2009 05:12 PM
Hi Jack,
First, have you tried opening up the image viewer to verify that the mask is being created properly?
Secondly, I would recommend using the template editor (found in National Instruments>Vision>Template Editor) if you are just using this for one or a few files. Then, you could create the template file and load it for future use.
08-18-2009 07:46 PM
Hi Marti,
I think all programmer wanna user create the template by himself program not lauch the template editor.
As the mention before, I use above program make a template file, but it can not be used in the pattern match. so I open the image for checking by template editor, it can be opened normally, and the mask area is black, it means it is a mask image. as you know, when we use the editor create the template, the area is red which you wanna ignore. am I right?
Yes, I can create the template with NI editor. but that's not good way.
Best regards,
Jack
08-19-2009 06:58 PM
Hi Jack,
I noticed that you are filling your mask with 255, which will make all the pixels black--is this what you are seeing? When you test it out are you seeing the template with a mask at all or the black?
08-19-2009 08:40 PM
1) CWIMAQVision1.RegionsToMask ImageMask, CWIMAQViewer2.Regions, CWIMAQViewer2.Image, 255
2) CWIMAQViewer2.Regions.RemoveAll
3) CWIMAQVision1.Xor ImageMask, 255, ImageMask
4) CWIMAQVision1.Mask CWIMAQViewer2.Image, ImageMask, CWIMAQViewer2.Image
please note line1 , as the mention before, user select a ROI in first, it is CWIMAQViewer2.Regions, then transform the ROI to ImageMask as mask.
Line4 just implement a mask by ImageMask, as the result, I saw the select ragion is black only.
08-20-2009 04:58 PM
Hi Jack,
The way that IMAQ saves masks is actually by saving an 8 bit image of that mask. I believe that if you were to take that 8 bit image and convert it to a binary image, save it, and then use this as the template, it would work. The red that you conventionally see for masks is a binary image. Try using that mask that you have converted from 8 bit image to a binary image, as the template.
Please let me know how this test goes.
11-01-2013 08:16 PM
In this illustrative example, we will create a program in Labview capture an image pattern, after the search to show the location and coordinates, you can check the following article in the following link