Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you mask pixels for learn golden template

I don't want use "NI vision template editor" to make the golden template for "IMAQ compare golden template VI", I want to implement it in my soure code in LabVIEW, but I failed on that mask a region in golden template to ignore during the golden template comparison. what I did is:

 

 

1. Load a image from file.

2. Extract a image based on ROI.

3. Use IMAQ learn template to learn the image (The input terminate "learn mask" is feeded a 2D arrary and all element with "1"). NI help for this terminate is: 

 

Learn Mask is an optional 8-bit image of the same size as the golden template that specifies which regions and edges to ignore when comparing images to a golden template. Use the following pixel values when constructing the mask:

  • 0—Maintains the default behavior.
  • 1—The corresponding pixel in the golden template should always be ignored.
  • 2—The corresponding pixel in the golden template is an edge and should be dilated according to the value of the Edge Thickness To Ignore parameter of the IMAQ Compare Golden Template VI.

4. Save to file with "IMAQ Write Image And Vision Info VI"

 

One example VI is attached below.

 

My quesition is :

Am I right on this procedure to create a golden template? if yes, what is the correct parameter for Learn mask terminate?

 

Thans a lot.

 

Steven

 

 

 

0 Kudos
Message 1 of 3
(3,087 Views)

Update:

After I use 255 instead 1 as the pixel values when constructing the mask, the correspond pixels in golden template is ignored. but however, the Edge Thickness To Ignore parameter of the IMAQ Compare Golden Template VI is not available any more, the description of Learn mask in NI help seems like a little bit incorrect, is there any body have experience on this issues?

 

Thanks. 

0 Kudos
Message 2 of 3
(3,069 Views)

Facing the same issue cant in help it says pixel value 2 would be ignore but its not so... still havent found an answer.

0 Kudos
Message 3 of 3
(389 Views)