Count Pixels Configuration

NI Vision Builder

Check for Presence Tab Measure Features Tab

How to Count Pixels

Main Tab

  1. In the Step Name control, enter a descriptive name for the step.
  2. Choose one of the following methods to specify the region of interest for the step:
    • Create a new region of interest.
      1. Select Constant from the Region of Interest listbox.
      2. Select a tool from the menu toolbar that matches the type of region of interest you want to specify.
      3. Draw a region of interest on the image.
    • Select a previously defined region of interest from the Region of Interest listbox.
  3. Verify that the Reposition Region of Interest option is enabled if you want to link the region of interest specified in this step to a previously defined coordinate system.

    Link the region of interest to a coordinate system if the position of the object under inspection changes from image to image, and you need to adjust the position of the region of interest to match the new location of the object.

Settings Tab

  1. Select the type of pixels you want to count in Look For.
  2. Select the thresholding method you want to use in Method. The histogram now shows the range of pixel intensities in the region of interest.
    • If you selected Manual Threshold in Method, use Lower Value and Upper Value to specify the threshold range.
    • If you selected an automatic thresholding method, Vision Builder AI uses that method to determine the threshold range that corresponds to the region of interest. Use Lower Limit and Upper Limit to coerce the threshold range to specific lower and upper values.
    • If you selected a local thresholding method, Vision Builder AI uses that method to calculate a threshold value for each pixel based on the statistics of surrounding pixels. These algorithms compensate for high lighting variations. Use Kernel Size to specify the approximate size of the desired objects to threshold.
Note  The Percentage of Pixels in Intensity Range control displays the percentage of pixels in the region of interest that are within the range or grayscale intensities you established.

Limits Tab

  1. Use the Minimum Percentage and Maximum Percentage and/or Minimum Number of Pixels and Maximum Number of Pixels controls to specify the valid range you want to use to determine if the inspection passes.

    Percentage of Pixels in Intensity Range displays the percentage of pixels in the region of interest that are within the range you established.

    Number of Pixels in Intensity Range displays the number of pixels in the region of interest that are within the range you established.

  2. Click OK to save the settings and close the Parameter window.