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