# ViDiELClassify3D

The ViDiELClassify3D function automatically classifies point cloud projection images into the defined classes based on an initial training image set. To use this function, you must define the classes, load an initial set of point clouds into the tool, and then individually label a subset of the training images to ensure that the tool recognizes the features on the projection images and classifies them correctly.

To use the ViDiELClassify3D function:

1. Drag and drop the ViDELClassify3D tool into the Spreadsheet.

   The property sheet pops up:

2. In the General tab of the property sheet, set up the Region of Interest using one of the following methods:

   - Double-click the Box3D parameter and adjust the ROI box in the acquisition display.

   - Expand the Box3D parameter and define the box parameters manually.

   - Double-click the External Box parameter and select a Box3D function cell in Spreadsheet.

3. In the Projection tab of the property sheet, select the Projection Mode, Feature Width, and Feature Height that you want the tool to use for training.

4. In the Train tab of the property sheet, add the classes you want the function to use.

   Note: Once you have started labeling, you cannot change the ROI size.
5. Click OK to close the property sheet.
6. In the Spreadsheet, check the checkbox in the Collect Samples cell of the function. This allows the tool to load images for training.
7. Load images into the function either by double-clicking the desired images in the Filmstrip, or by clicking the Play button in the Filmstrip controls to load all of the images in the Filmstrip.
8. Once you have loaded the training images, uncheck the checkbox in the Collect Samples cell of the function.

9. Double-click the ViDiELClassify3D cell in the Spreadsheet to re-open the property sheet.

   Note: If you change the Projection Mode or use Auto-Tune, you have to close the property sheet, then re-open the property sheet again to see the training images with the updated projection mode in the Train and Images tabs of the property sheet.
10. Click OK to close the property sheet, then re-open the property sheet again to see the training images with updated projection parameters in the Train and Images tabs of the property sheet.

11. In the Train tab, label the training images one-by-one according to the desired class. Alternatively, you can label multiple images at the same time in the Images tab by dragging and dropping them into the Labeled Images column of the desired class. Press Ctrl and click to select multiple images in the Images tab.

12. As your training images are labeled, the Model Health percentage in the Images tab starts to rise. Keep labeling images until the Model Health is sufficiently high.
13. Once you have trained the function, you can click the Auto-Tune button in the Projection tab to enable projection auto tuning. If projection auto tuning is enabled, the function analyzes the projection images of the training samples using different projection settings and selects the best projection settings based on the analysis results.
14. Click OK to finalize the function settings.

Inputs

Setting | Description
PointCloud | Reference to a cell containing a point cloud. The default value is $A$0.
Fixture3D | Specifies the point cloud coordinate system in which the 3D fixture is defined. It is offset from the PointCloud origin in the following format with the following arguments: {X, Y, Z, Rotation, Tilt, TiltDirection}
X | Offset on the X-axis from the PointCloud origin.
Y | Offset on the Y-axis from the PointCloud origin.
Z | Offset on the Z-axis from the PointCloud origin.
Rotation | Specifies the in-plane rotation in degrees around the PointCloud Z-axis. The value range is -180 to 180. The tool normalizes external references with values outside the allowed range to the allowed range.
Tilt | Specifies the tilt angle in degrees from the PointCloud Z-axis after rotation. The value range is 0-180. External references with values outside the allowed range result in an error.
Tilt Direction | Specifies the direction of tilt in degrees from the rotated PointCloud X-axis of the tool, around the PointCloud Z-axis of the tool. The value range is -180 to 180. The tool normalizes external references with values outside the allowed range to the allowed range.
Note: The Fixture3D parameter is only available if you set External Fixture to 0.
External Fixture | Specifies a reference to a Fixture3D structure defined in another cell. The function uses the referenced cell as the fixture of the function. Set to 0 (OFF) to use the internal fixture of the function instead.
Box3D | Specifies the dimensions, offset and angle for the 3D rectangle of the function. It is offset from the PointCloud origin in the following format with the following arguments: {SizeX, SizeY, X, Y, Z, Rotation, Tilt, TiltDirection}
SizeX | The size of the box along the X-axis of the PointCloud. The value range is 0.001 to inf., and the default value is 100.
SizeY | The size of the box along the Y-axis of the PointCloud. The value range is 0.001 to inf., and the default value is 100.
SizeZ | The size of the box along the Z-axis of the PointCloud. The value range is 0.001 to inf., and the default value is 100.
X | Offset on the X-axis from the PointCloud origin. The value range is -inf. to inf., and the default value is 0.
Y | Offset on the Y-axis from the PointCloud origin. The value range is -inf. to inf., and the default value is 0.
Z | Offset on the Z-axis from the PointCloud origin. The value range is -inf. to inf., and the default value is 0.
Rotation | Specifies the in-plane rotation of the box (in degrees) about the PointCloud Z-axis of the tool. The value range is -360 to 360. External references with values outside the allowed range will be normalized to the allowed range.
Tilt | Specifies the tilt angle of the box (in degrees) from the PointCloud Z-axis of the tool. The value range is 0 - 180. External references with values outside the allowed range will result in an error.
Tilt Direction | Specifies the tilt direction of the box (in degrees) from the rotated PointCloud X-axis of the tool, about the PointCloud Z-axis of the tool. The value range is -360 to 360. External references with values outside the allowed range will be normalized to the allowed range.
Note: This parameter is available only if External Box is set to 0.
External Box | Specifies a reference to a Box3D structure defined in another cell to be used with the function. Set to 0 (OFF) to use the internal Box3D structure of the function.
Projection Image Resolution | Specifies the resolution of the image to be generated from the point cloud within the region of interest. Low, Medium, or High.
Collect Samples | Enables or disables sample collection for training.
Show | Select the type of graphic to overlay on the image.

Projection Parameters

Setting | Description
--- | ---
Projection Mode | Specifies the mode used to create the sample 2D image from the point cloud.
Height Map | The Height Map projection mode creates three-dimensional height maps. This projection mode collects 3D data points within the ROI, and transforms them into a 2D height data representation, where the assigned height value for each pixel signifies the average distance between the points within the corresponding XY cell and the bottom of the ROI box. The projection mode fixes minor irregularities in the height data and directly maps it to an 8-bit image. In this mapped image, pixel values range from 0 (bottom of the box) to 255 (top of the box).
Automatic Height Map | The Automatic Height Map projection mode creates three-dimensional height maps, automatically selecting the height range. This projection mode collects 3D data points within the ROI, and transforms them into a 2D height data representation, similar to the Height projection mode. This mode automatically sets the height range for optimal results.
Shape Change | The Shape Change projection mode identifies 3D depth along the XYZ axes, and visualizes 3D structural variations along the X, Y, and Z axes. This projection mode collects 3D data points within the ROI, and projects them into a 2D data representation. Changes are color coded relative to the X, Y, and Z axes in order to highlight changes in the orientation of surface normals. Estimated kernel sizes for surface normals are set based on the parameter feature width. This projection mode amplifies edges, but is less sensitive to height changes.
Vertical Shape Change | The Vertical Shape Change projection mode identifies 3D depth along the Z-axis. The Vertical Shape Change projection mode is designed to identify and visualize 3D structural variations along the Z-axis. This projection mode collects 3D data points within the ROI, and projects them into a 2D data representation, highlighting changes in the orientation of surface normals relative to the Z axis. Estimated kernel sizes for surface normals are set based on the parameter feature width. This projection mode amplifies edges, but is less sensitive to height changes.
Flex Inspect | The Flex Inspect projection mode creates projection images that identify features and anomalies on a smooth freeform surface, where the coverage of features is expected to be a small portion of the entire surface. If the features of interest do not have a sufficiently large and clear background surface area, projection images can have bad contrast between features and surrounding areas. This projection mode estimates the shape of the local background as a freeform surface, and shows height changes relative to the local background shape. This mode computes the average height in the neighborhood of a pixel according to the user-defined feature width, and overlays the difference between pixel height and the computed average height onto the projection according to the user-defined feature height.
Curve Inspect | The Curve Inspect projection modecreates projection images that identify features and anomalies on a smooth curved surface, where the coverage of features is expected to be a small portion of the entire surface. If the features of interest do not have a sufficiently large and clear background surface area, projection images can have bad contrast between features and surrounding areas. This projection mode estimates the shape of the local background as a curved surface, and shows height changes relative to the local background shape. This mode computes a curved surface model based on pixel neighborhoods according to the user-defined feature width, and overlays the difference between pixel height and the surface model onto the projection according to the user-defined feature height.
Greyscale | The Greyscale projection mode identifies overall 2D surface flaws. This projection mode is a direct mapping technique from the height data addressed to an 8-bit image. In this mapping, the value of each pixel in the resulting image corresponds directly to the intensity of the original 3D points.
Feature Width | Specifies the expected width of a feature of interest in millimeters.
Feature Height | Specifies the expected height of a feature of interest in millimeters.
Auto-Tune | Runs the configured function using multiple different projection parameters, and selects the best scoring settings. This button is disabled until you have labeled a sufficient amount of images.

Outputs

Output | Description
Unlabeled | The number of loaded images that are unlabeled.
Health | The Model Health of the function.
Passed | Boolean value indicating the success of the function.
Num Class | The number of defined classes.
Index | The index of the defined classes.
Label | The name of the defined classes.
Num Images | The number of classified images in the defined classes.
Score | The overall confidence score for the defined classes.