Classify Objects Controls

NI Vision Builder

Identify Parts Tab

Classify Objects Controls

Main Tab

The following controls are available on the Main tab.

Control Name Description
Step Name Name to give the step.
Region of Interest The region of interest you want to use for 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.
Classifier File Path Path of the classifier file you want to use to classify samples. A classifier file contains a representation for each trained sample as well as its corresponding label.
New Classifier File Launches the NI Classification Training Interface so you can create a new classifier file.
Samples Indicates the number of samples learned in the selected classifier file.

Threshold Tab

The following controls are available on the Threshold tab.

Control Name Description
Method You can choose to perform a manual or automatic threshold. To threshold manually, select Manual Threshold from the Method drop-down menu.

For automatic thresholding, the following options are available:

  • Clustering—Sorts the histogram of the image within a discrete number of classes corresponding to the number of phases perceived in an image. Clustering is the most frequently used automatic thresholding method.
  • Entropy—Detects samples that are present in minuscule proportions on the image.
  • Metric—Calculates a value for each threshold determined by the surfaces representing the initial gray scale.
  • Moments—Use for images that have poor contrast.
  • Inter Variance—Use for images in which classes are not too disproportionate. For best results, the smallest class must be at least 5% of the largest one.
Look For Specifies the type of objects to search for in the image. The following options are available:
  • Bright Objects—When selected, the step counts bright pixels whose intensity values range from Lower Value to 255.
  • Dark Objects—When selected, the step counts dark pixels whose intensity values range from 0 to Upper Value.
  • Gray Objects—When selected, the step counts gray pixels whose intensity values range from Lower Value to Upper Value.
Range Use the following controls to specify the threshold range.
  • Min—The lower value of the threshold range when you use the Manual Threshold method. For automatic thresholding methods, Min displays the value computed by the selected method when Bright Objects is selected in the Look For control.
  • Max—The upper value of the threshold range when you use the Manual Threshold Method. For automatic thresholding methods, Max displays the value computed by the selected method when Dark Objects is selected in the Look For control.
  • Lower Limit—Lower limit of the thresholding range when you use one of the automatic thresholding methods. The automatic thresholding algorithm you select cannot compute a threshold value lower than Lower Limit.
  • Upper Limit—Upper Limit of the thresholding range when you use one of the automatic thresholding methods. The automatic thresholding algorithm you select cannot compute a threshold value greater than Upper Limit.
Ignore Objects Touching Region Borders Ignores objects in the sample that are touching the border of the region of interest.
Remove Small Objects (# of Erosions) Number of erosions you want the classification engine to perform to remove small objects in the sample from the region of interest.

Options Tab

The following controls are available on the Options tab.

Control Name Description
Method Method of classification. The following options are available:
  • Nearest Neighbor—Most direct approach to classification. In nearest neighbor classification, the distance of an input feature vector of unknown class to another class is defined as the distance to the closest samples that are used to represent that class.
  • K-Nearest Neighbor—More tolerant of noise compared with nearest neighbor classification. In K-nearest neighbor classification, an input feature vector is classified into a class based on a voting mechanism. The NI Classifier finds K nearest samples from all the classes. The input feature vector of unknown class is assigned to the class with majority of the votes in the K nearest samples.
  • Minimum Mean Distance—Most effective in applications that have little or no feature pattern variability or other corruptive influences. In minimum mean distance classification, an input feature vector of unknown class is classified based on its distance to each class center.
Metric Computes the distance between features in a classification application. The following options are available:
  • Maximum—Most sensitive to small variations between samples. Use Maximum when you need to classify samples with very small differences into different classes.
  • Sum—Metric used in most classification applications. Sum is also known as the Manhattan metric or Taxicab metric. This is the default Metric value.
  • Euclidean—Least sensitive to small variations between samples. Use Euclidean when you need to classify samples with small differences into the same class.
K Sets the K value when using the K-Nearest Neighbor method of classification. The default is 3.
Scale Dependent and Mirror Dependent Define the dependence of the classification engine on shape, scale, and mirror symmetry. By default, when the Scale Dependent and Mirror Dependent options are disabled, the NI Classifier depends only on variations in shape to classify samples. When Scale Dependent and Mirror Dependent are enabled, the dependence on shape is calculated by the following formula:

Shape Dependence = 1000 - (Scale Factor + Mirror Factor)

  • Scale Factor—Determines the relative importance (between 0 and 1000) of scale when classifying samples. If the value is 0, the samples are classified independent of scale.
  • Mirror Factor—Determines the relative importance (between 0 and 1000) of mirror symmetry when classifying samples. If the value is 0, the samples are classified independent of mirror symmetry. An example of objects that exhibit mirror symmetry are a lowercase letter p and a lowercase letter q.

Classify Tab

The following controls are available on the Classify tab.

Control Name Description
Classification Criteria All of the classes associated with the classifier file will be listed in the Classification Criteria table.

The first column provides a checkbox so you can specify if you are interested in looking for objects of this class. If the checkbox is selected, the minimum classification score and minimum identification score are used to determine if an object belongs to this class. If the box is not checked, any objects identified as this class will be classified as Other.

  • Label—The name of the class.
  • Class—The minimum classification score an object can have and still be identified as part of this class.
  • Ident—The minimum identification score an object can have and still be identified as part of this class.
    Note  If a class label is selected, an object of this class must have a classification and identification score higher than the minimum score to be considered part of this class. Objects with a score lower than the minimum are classified as Other.
Classify Only Largest Object Specifies whether all objects in the region of interest are classified or only the largest object.
Results Lists the objects are identified in the region of interest. Objects in the Other class are a different color with parentheses around the class label.
  • Label—The name of the class.
  • Class—The Classification Score of the object.
  • Ident—The Identification Score of the object.
  • X—X-coordinate of the object center of mass.
  • Y—Y-coordinate of the object center of mass.
    Note  If you calibrate the image using the Calibrate Image step, X and Y are returned in the calibration unit you specify. Otherwise, X and Y are returned as uncalibrated units.

Limits Tab

Only classes selected in the Classify Tab will appear in the Classification Results table in addition to the Other class. When a class is selected, the number of objects of this class in the region of interest must be between the Minimum and Maximum values in order for the step to pass.