Detect Objects Configuration

NI Vision Builder

Check for Presence Locate Features Tab

How to Detect Objects

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 that includes all of the objects you want to detect. Minimize the number of noisy objects in the region of interest to improve the accuracy of the inspection step.
        Note  A noisy object is an object with characteristics similar to the objects you want to detect but is irrelevant to the current inspection step.
    • Select a previously defined region of interest from the Region of Interest listbox.

      When you specify a region of interest, the step automatically tries to locate objects in the region. Pixels with intensity values in the specified threshold range appear blue in the image. A red region and label mark the bounding rectangles of each individual object that the step located.

  3. Verify that the Reposition Region of Interest checkbox 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.

Threshold Tab

  1. Choose the type of objects you want to detect from the Look For control.

    If the intensities of the pixels that belong to objects of interest are brighter (greater) than the surrounding—particularly if the pixels along the inside boundary of the objects are brighter than their surrounding pixels—choose Bright Objects. If the pixels that belong to the objects of interest are darker (less) than their surrounding pixels, choose Dark Objects. In all other cases, choose Gray Objects.

  2. Select the thresholding method you want to use from the Method listbox. This Histogram shows the range of pixel intensities in the region of interest.
  3. Specify the threshold range.
    • For Manual Thresholding methods, use the Lower Value and Upper Value controls to specify the threshold range.
      Note  You can specify a constant, a previous measurement, or a variable for the threshold range.
    • For Automatic Thresholding methods, the step automatically specifies a threshold range corresponding to the region of interest based on the selected thresholding Method. Use the Lower Limit and Upper Limit controls to coerce the threshold range to use a specific range of values.
    • For Local Thresholding methods, the step calculates threshold values for each pixel based on the statistics of surrounding pixels. Use the Kernel size control to specify the approximate size of the objects to threshold.
  4. Study the blue regions in the image. If all of the objects you want to detect are highlighted with a red rectangle, go to step 12. Otherwise, adjust the settings in the Settings tab.

Settings Tab

  1. Enable the Ignore Objects Touching Region of Interest control to remove objects that touch the border of the inspection region. Information about these objects is usually incomplete, so you may want to ignore them.
  2. Enable the Fill Holes Within Objects control to remove any holes within the detected objects. Enabling this control results in more accurate area measurements when you are uncertain about the optimal threshold range.
    Note  Do not enable this option if your object is supposed to have physical holes in it.
  3. Enable the Minimum Object Size and Maximum Object Size controls to limit the area of the objects you want to find. Use the Object Measurement table to determine the size of your objects of interest.
  4. Specify the order in which the objects are returned using the Sort by control. By default, objects are listed in the order the algorithm detected them, scanning the region of interest horizontally from top left to bottom right.

Limits Tab

  1. Set the minimum and/or maximum number of objects that you expect to find.