Classify Samples

NI Vision Assistant

Classify Samples

Follow these instructions to classify a sample in a given region of interest (ROI):

Main Tab

  1. In the Step Name control, enter a descriptive name for the step.
  2. 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.

Train Tab

  1. Browse to the classifier file you want to use, select the file, and click Open.
  2. If you want to create a new classifier file, click New Classifier File. In the Save Classifier File As window, enter the file name for the file you want to create.
  3. Click OK to open the NI Classification Training Interface.
    Tip  Refer to the NI Classification Training Interface Help for more information about how to train and classify samples in the Classification Training Interface.
    Note  If necessary, click Edit Classifier File to classify additional samples in the NI Classification Training Interface.
  4. Draw an ROI around the sample you want to classify.

    Vision Assistant segments samples in the ROI by drawing particle bounding rectangles around the samples according to the current settings in the Main, Threshold, Engine Options, and Parameters tabs.

Threshold Tab

Note  Configure options in the Threshold tab carefully. If you manually set the threshold values and the classification engine cannot detect samples in the region you specified, the training process does not create the classifier file correctly.
  1. Select a threshold type from the Method control. When you select Manual Threshold, you must set the threshold range with the Min and Max controls.
  2. Select the type of objects you want to classify in the sample from the Look For control. You can classify Bright Objects, Dark Objects, or Gray Objects.
  3. Enable the Ignore Objects Touching Region Borders control to ignore objects in the sample that touch the border of the ROI.
  4. In Remove Small Objects (# of Erosions), select the number of erosions to remove small objects in the sample from the ROI.

    The classification engine displays segmented objects in blue.

Options Tab

Use the controls to indicate the Method and Metric used by the classification engine for sample recognition.

Parameters Tab

  1. Enable the Scale Dependent control to determine the relative importance of scale when classifying samples. Enter the numerical scale value (between 0 and 1000) in the Scale Factor control. If the value is 0, samples are classified independent of scale.
  2. Enable the Mirror Dependent to determine the relative importance of mirror symmetry when classifying samples. Enter the numerical value of importance (between 0 and 1000) for the mirror symmetry in the Mirror Factor control. If the value is 0, samples are classified independent of mirror symmetry.