Surface Segmentation

The Segmentation tool separates surface data into "segments," based on the tool's parameters. Segments can be touching and overlapping to a certain degree. The Segmentation tool is especially useful in the food industry, for example to identify food items that are too small or too big, or items that are damaged.

For each segment, the tool returns the X and Y position of the center of its bounding box, its length and width, and its area, as well as several more global measurements, such as maximum / minimum width or length, and so on. For a complete list, see below.

The Segmentation tool can also be used as a second stage of processing after part detection. For example, part detection could be used to detect a tray (containing parts), and the Segmentation tool could then separate the parts within the tray. For information on part detection, see Profile Part Detection.

The Segmentation tool cannot handle large overlaps.

The Segmentation tool does not perform template matching.

To reduce processing time, consider using the decimation filter. For more information on this filter, see Surface Filter.

For information on adding, managing, and removing tools, as well as detailed descriptions of settings common to most tools, see Tool Configuration.

Inputs

You configure the tool's inputs in the expandable Inputs section.

To use a measurement as an anchor, it must be enabled and properly configured in the tool providing the anchor. For more information on anchoring, see Measurement Anchoring.

Inputs
Name Description
Enable Batching

When Enable Batching is checked, the tool takes an array as input and processes each surface in the array individually. There is no limit to the size of the array, other than processing limitations of the sensor.

For more information on arrays, batching, and aggregating, see Arrays, Batching, and Aggregation.

Surface Input

The data the tool applies measurements to or processes.

Anchor X

Anchor Y

Anchor Z

The X, Y, or Z measurement of another tool that this tool uses as a positional anchor. Positional anchors are optional.

Anchor Z Angle

The Z Angle measurement of another tool to use as a rotational anchor for this tool. Rotational anchors are optional.

Parameters

You configure the tool's parameters in the expandable Parameters section.

Parameters
Parameter Description

Use Intensity

Causes the tool to use intensity. Acquire intensity must be enabled on the Scan page; otherwise, the tool will display an error.

Regions

When expanded, displays the region- and mask-related settings.

Enable

Enables regions and displays the region- and mask-related settings (see below).

Mask Mode

Number of Regions

Region Type {n}

Region {n}

When you enable regions (see above), the tool displays additional settings related to the region type. For details on the regions supported by this tool and their settings, see Flexible Regions.

For general information on regions and the difference between standard and "flexible" regions, see Regions.

Part Area Min

Part Area Max

The minimum and maximum areas in square millimeters for a part of the scan data to be identified as a segment.

Part Aspect Min

Part Aspect Max

The minimum and maximum aspect ratios (minimum axis length in mm) / (maximum axis length in mm) of the best fit ellipse to the segment contour points for a segment to qualify to be added to the list of found segments.

Background Filter Kern Size

Background Filter Iterations

These settings perform background separation. The greater each of these values is, the more separation will be achieved. You must find a balance that removes noise adequately without degrading the segment find quality.

Edge Filter Kernel

Use this value to adjust the “granularity” of the part edge detection.

Edge Filter Threshold

Controls the separation of the parts, increasing the gap between the parts so that they can be detected more easily.

Hierarchy

Use this setting to detect segments when they are surrounded by background data. Choose one of the following: All Parts or External Parts.

All Parts

This option lets you segment parts with surrounding background data.

For example, in the following image, with All Parts selected, the sphere is correctly segmented from the surrounding background.

Note that this option may result in "over-segmentation": the tool may segment a part into two segments.

External Parts

In the following image, the sphere is not identified as a segment because of the surrounding background. It is treated as part of a large segment that includes all of the scan data.

Use Margins

Margins

Left

Right

Top

Bottom

When Use Margins is enabled, the tool discards parts whose center point is within the margins defined in the expandable Margins section. Margins extend inwards from the outer edges of the sensor's FOV (XY scan area) and are positive.

In the following, with margins set to 0, nine parts are detected

In the following, the left and right margins are set to 20 mm, and the top and bottom margins are set to 25 mm. The sensor's FOV is 100 x 154 mm. The tool discards the four parts whose center points are within those margins. (Total part count is reduced to five.)

Ordering

Orders the measurements, features, and surface data of the individual parts output by the tool. Choose one of the following:

  • Area - Large to small
  • Area - Small to large
  • Position - X increasing
  • Position - X decreasing
  • Position - Y increasing
  • Position - Y decreasing
  • Position - Z increasing
  • Position - Z decreasing

Accurate Measurements

Returns more accurate width, height, and area measurements, as well as a better Surface output, but the trade-off is greater processing time. If you only need center points or the number of parts, disable this parameter for faster processing..

Show Details

Toggles whether the tool displays the index and area of each individual part. Enabling this will increase processing time.

Enable Array Output

When Enable Array Output is disabled, the tool outputs each part as an individual Surface output.

When Enable Array Output is enabled, the tool outputs parts in arrays. Be sure to enable the Part Surface in the Outputs section after enabling this parameter. For more information on arrays, batching, and aggregating, see Arrays, Batching, and Aggregation.

Number of Part Outputs

Determines the number of parts the tool outputs as measurements, features (center points of parts), and surface data. Currently limited to 200 parts. If Enable Array Output is checked, this parameter is hidden and all parts are output in arrays.

External ID

The external ID of the tool that appears in GoHMI Designer. For more information, see GoHMI and GoHMI Designer.

Outputs

All tools provide measurements, geometric features, or data as outputs.

You configure the Min and Max parameters by expanding the measurement in the Outputs section. In order for a measurement to return a Pass decision, the measurement must be between maximum and minimum values; the range is inclusive.

When Enable Array Output is unchecked, individual measurement and feature outputs are produced for each part, for example, Max Z 1, Max Z 2, and so on, or Center 1, Center 2, and so on. When this parameter is checked, these measurements and features are output as arrays.

Measurements
Measurement

Part Count

Returns the total number of segments identified, based on the tool's parameters.

Min Dimension

Max Dimension

The minimum and maximum dimensions among all of the identified segments, respectively.

Mean Width

Mean Length

The mean width and length of the segments, respectively.

Min Area

Max Area

The minimum and maximum area among all of the identified segments, respectively.

Sum Area

The sum of the areas of the segments.

Mean Area

The mean area of the segments.

Min Height

Max Height

Mean Height

The minimum, maximum, and mean heights among all of the identified segments, respecitvely.

X Center {n}

Y Center {n}

The X and Y positions of the center of a part segmented from the surface.

Width {n}

Length {n}

The width and length of a part segmented from the surface. These are always the major and minor axis of a part, respectively.

Area {n}

The area of a part segmented from the surface.

The area is calculated using the contour of the part and resampling. For this reason, areas calculated using the Surface Volume tool will produce different measurements; for more information, see Area.

Features
Type Description
Center {n}

The point representing the center of a segmented part.

Data
Type Description

Part Surface {n}

Surface data corresponding to each segmented part.

Diagnostic

Surface data you can use to evaluate the impact of the tool's kern size and iteration settings, which the tool uses to separate potential segments.