Adv. Straight Edge Configuration

NI Vision Builder

Locate Features Tab

How to Find a Straight Edge

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.

    When you specify a region of interest, the step automatically tries to locate a straight edge in the region. If the automatically located edge corresponds to the edge you expected to find, proceed to step 8. Otherwise, proceed to step 3.

  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.
    Tip  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.

Edge Detector Settings Tab

  1. Select the direction properties of the search lines. Select a search direction that is perpendicular to the edge. For example, the orientation of the edge in the following figure is vertical. Therefore, the search direction is horizontal.

    Also, select the search direction along the lines that has the least number of obstacles between the edge of the region and the object edge you want to find. In the following figure, the search direction is right to left so that the step avoids detecting the edges of miscellaneous objects.

    1  Edge to Locate   3  Search Lines  
    2  Search Region   4  Miscellaneous Objects in the Image  
  2. If the step does not locate the correct edge, disable the Suggest Values control, and adjust the blue edge strength line so that it lies slightly below the top of the edge peak but above all of the other peaks. If the Edge Strength Profile does not contain a strong edge peak, adjust the edge detection controls until a peak appears.

    The following is a list of guidelines for adjusting the controls on the Edge Detector Settings tab.

    • If the correct edge points are detected along the search lines but no straight edges are found, It is likely that there are multiple strong edges along each search line. Reduce the Minimum Edge SNR until the step finds a straight edge. Adjusting the Gap between search lines can also help detect straight edges.
    • If the correct edge points are not detected along the search lines, complete the following steps to try to refine the edge detection:
      1. Analyze the Edge Strength Profile for each line. If the edge profile contains peaks at the location where you expect edges, reduce the blue edge strength line so that it lies slightly below the top edge peak, and, if possible, above all other peaks.
      2. If the Edge Strength Profile does not contain a strong peak, adjust the following controls:
        • If the intensity along the edge changes gradually, increase the Kernel Size.
        • If the image is noisy, increase the Projection Width.
        • If the image contains salt and pepper, or speckled noise, set the Projection Method to Median.
    • If the location of the detected straight edge is slightly inaccurate, set the Interpolation Mode to Bilinear.

Straight Edge Settings Tab

  1. In the # Straight Edges Requested control, set the number of edges you want to find in the image.
  2. If necessary, disable the Suggest Values control and use the other controls on the Edge Settings tab to specify additional criteria for determining edges.

Limits Tab

  1. Set the limits that correspond to the specifications of the edges you want to find in the image.
  2. Click OK to add the step to the inspection.