IMAQ Setup Match Color Pattern VI

LabView NI Vision

IMAQ Setup Match Color Pattern VI

Owning Palette: Searching and MatchingInstalled With: NI Vision Development Module

Sets parameters that are used during the color matching process. Run this VI before using the IMAQ Match Color Pattern VI.

Examples

IMAQ Setup Match Color Pattern

csgl.gif

Color Score Weight (between 0 and 1000) determines the percent contribution of the color score to the final color pattern matching score. The software uses the color score weight for the final match ranking. For example, if you use a weight of 1000, the algorithm finds each match by using both color and shape information and then ranks the matches based on their color scores. If the weight is 0, the matches are ranked based on their shape scores. The default is 500, indicating that the match score uses an equal combination of the color and shape scores.

ci32.gif

Minimum Contrast specifies the minimum expected difference between the maximum luminance value and the minimum luminance value of the color pixels in the inspection image. The default is 0, which allows the algorithm to compute the Minimum Contrast.

cu32.gif

Match Mode specifies the invariance mode to use when looking for the color template pattern in the inspection image. Choose from the following values:

Shift Invariant (0)

(Default) Searches for the color template pattern in the image, assuming it is not rotated more than 4 degrees.

Rotation Invariant (1)

Searches for the color template pattern in the image with no restriction on the rotation of the template.

cu32.gif

Match Feature Mode specifies the features to use when looking for the color template pattern in the color image. The following values are valid:

Color and Shape (0)

(Default) Searches for the color template pattern in the image using color and shape features.

Color (1)

Searches for the color template pattern in the image using color features.

Shape (2)

Searches for the color template pattern in the image using shape features.

cbool.gif

Subpixel Accuracy determines whether to return the match results with subpixel accuracy. The default is FALSE. If Match Feature Mode is set to color, the VI ignores Subpixel Accuracy.

c1dnclst.gif

Rotation Angle Ranges (degrees) is an array of angle ranges, where each range specifies how much you expect the color template to rotate in the inspection image. Specify a lower and upper angle, in degrees, for each range.

cerrcodeclst.gif

error in (no error) describes the error status before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.

cbool.gif

status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.

ci32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

cstr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

cu32.gif

Color Sensitivity specifies the sensitivity of the color information in the image. The default is Low. Set this option to High when you need to distinguish colors with close hue values.

cu32.gif

Search Strategy specifies how the color features of the image are used during the search phase. Choose from the following strategies:

Conservative (0)

Uses a very small step size, the least amount of subsampling, and all the color information present in the template. The conservative strategy is the most reliable method to look for a template in any image at potentially reduced speed.

Balanced (1)

Uses values in between the aggressive and conservative strategies.

Aggressive (2)

Uses a large step size, a lot of subsampling, and all the color spectrum information from the template.

Very Aggressive (3)

Uses the largest step size, the most subsampling, and only the dominant color from the template to search for the template. Use this strategy when the color in the template is almost uniform, the template is well contrasted from the background and there is a good amount of separation between different occurrences of the template in the image. This strategy is the fastest way to find templates in an image.

istr.gif

Match Color Pattern Setup Data is a string that contains information about the setup parameters selected for the matching phase. Connect this output to the IMAQ Match Color Pattern VI.

ierrcodeclst.gif

error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out indicator on the front panel and select Explain Error from the shortcut menu for more information about the error.

ibool.gif

status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.

ii32.gif

code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.

istr.gif

source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.

Examples

Refer to the following for examples that use this VI.

  • LabVIEW\examples\Vision\2. Functions\Color Pattern Matching\Color Pattern Matching Example.llb

  • LabVIEW\examples\Vision\3. Applications\Fusebox Inspection Example.llb