Color Location

NI Vision Assistant

Color Location

Locates colors in a color image.

Main Tab

The following controls are available on the Main tab.

  • Step Name—Name to give the step.
  • Reposition Region of Interest—When enabled, the step dynamically repositions the region of interest based on a coordinate system you built in a previous step.
  • Reference Coordinate System—Coordinate system to which you want to link the region of interest.

Template Tab

The following controls are available on the Template tab.

  • Template Image—The image to use as the template.
  • Template Size
    • Width—Width of the template in pixels.
    • Height—Height of the template in pixels.
  • Ignore Black and White
    • Disabled—Specifies that black and white pixels are not ignored during the search phase.
    • Ignore Black—Specifies that black pixels are ignored during the search phase.
    • Ignore White—Specifies that white pixels are ignored during the search phase.
    • Ignore Black and White—Specifies that black and white pixels are ignored during the search phase.
  • Sat. Threshold—Specifies the threshold used to distinguish between two colors having the same hue values. For more information about saturation threshold, refer to the NI Vision Concepts Manual.
  • Create Template—Learns the selected ROI and saves the result as a template image file.
  • Load from File—Launches a dialog box in which you can browse to a template image file and specify that file as the search template.
  • Template Path—Displays the location of the template image file.

Settings Tab

The following controls are available on the Settings tab.

  • Number of Matches to Find—Specifies the number of valid matches you expect the color location function to return.
  • Minimum Score—Specifies the minimum score an instance of the template can have to be considered a valid match. This value can range from 0 to 1000, where a score of 1000 indicates a perfect match.
  • Search Strategy—Specifies how the color features of the image are used during the search phase. You can choose from the following three strategies:
    • Conservative (default)—Uses the smallest step size, a sub-sampling factor of two, and all the color information present in the template to search for a template. The Conservative strategy is the most reliable method to look for a template in any image at potentially reduced speed.
      Note  Use the Conservative strategy if you have multiple matches located very close to each other in the image.
    • Balance—Uses values between the Aggressive and Conservative strategies.
    • Aggressive—Uses values between the Balanced and Very Aggressive strategies.
    • Very Aggressive—Uses the largest step size, the most sub-sampling, 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. The Very Aggressive strategy is the fastest way to find templates in an image.
      Tip  You can specify a search area by drawing an ROI on the image with the Rectangle tool. Specifying a search area increases the speed and reliability of the color location function.
  • Color Sensitivity—Specifies the level of color sensitivity in the image. The default is Low sensitivity.
  • Color Spectrum—Represents the color information associated with the template.

Results

Displays the following information after searching the image for the template:

  • Center X—X-coordinate of each object that matches the template.
  • Center Y—Y-coordinate of each object that matches the template.
  • Score—Score of each valid match. Score values can range from 0 to 1000, where a score of 1000 indicates a perfect match.