Match Color Pattern Concepts

NI Vision Builder

Check for Presence Locate Features Tab

Match Color Pattern Concepts

The selection of a good template image plays a critical part in obtaining accurate results with the color pattern matching algorithm. Because the template image represents the color and the pattern that you want to find, make sure that all the important and unique characteristics of the pattern are well defined in the image.

Several factors are critical in creating a template image. These critical factors include color information, symmetry, feature detail, positional information, and background information. Refer to Match Pattern Concepts for more information about some of these factors.

  • Color Information—A template with colors that are unique to the pattern provides better results than a template that contains many colors, especially colors found in the background or other objects in the image.
  • Symmetry—A rotationally symmetric template in the luminance plane is less sensitive to changes in rotation than one that is rotationally asymmetric.
  • Feature detail—A template with relatively coarse features is less sensitive to variations in size and rotation than a model with fine features. However, the model must contain enough detail to identify it.
  • Positional information—A color template whose luminance plane contains strong edges in both the x and y directions is easier to locate.
  • Background information—Unique background information in a template improves search performance and accuracy during the grayscale pattern matching phase. This requirement could conflict with the color information requirement of color pattern matching because background colors may not be desirable during the color location phase. Avoid this problem by choosing a template with sufficient background information for grayscale pattern matching while specifying the exclusion of the background color during the color location phase.

Extend the region of interest to the edges of the image when you want to locate the template anywhere in the image. Decrease the region so that it surrounds only the portion of the object that contains the learned template when you want to locate a part only in a specific area of the image. If necessary, decrease the size of the region of inspection to optimize the search speed and minimize the risk of a mismatch.