Generate Path from Contour

Function

This Step generates a path from the input edge point cloud.

Usage Scenario

This Step is typically used in edge gluing applications for objects such as rectangular hatches/glass.

Input and Output

../../../../../_images/input_and_output24.png

Parameter Description

This Step includes 4 parameter groups, and the descriptions are as follows:

  • General Params: This parameter group is used for general settings. Please adjust the parameters according to the actual requirement.

  • Smooth Points: When the edge point cloud of the object is jagged, you may need to adjust this parameter group to make the edge point cloud smoother.

  • Special Side Erode: This parameter group is designed for special applications, and it does not need to be adjusted in general.

  • Find Corners: When there are obvious corners on the edge point cloud, you will need to adjust this parameter group.

General Params

Mask Closing Kernel Size
Description: This parameter is used to set the size of the kernel when a closing operation is applied to the image mask. The unit is pixels.
Default value: 5 px
Points Sample Size
Description: This parameter is used to specify the interval between waypoints in the generated path. The unit is pixels. The larger the value, the larger the interval between waypoints. Please refer to the tuning example for the application result.
Default value: 10 px
Edge Zoom Type
Description: This parameter is used to select the method to generate a path based on the edge point cloud.
Value list: ByErode, ByVertical
  • ByErode: generates a path by erosion operation.

  • ByVertical: generates a path by calculating vertical lines of the point tangent lines on the edge point cloud.

Default value: ByErode
Tuning recommendation: It is recommended to select ByErode.
Erode Kernel Size
Description: When the Edge Zoom Type is set to ByErode, this parameter is used to determine the distance between the path and the object edge and whether the path is within or outside the object edge. The unit is pixels. When the parameter value is positive, the generated path will be within the object edge; when the parameter value is negative, the generated path will be outside the object edge. The larger the positive value, the more the generated paths will shrink towards the inside of the object. Please refer to the tuning example for the application result.
Default value: 15 px
Vertical Move Real Dis
Description: When the Edge Zoom Type is set to ByVertical, this parameter is used to determine the distance between the path and the object edge and whether the path is within or outside the object edge. The unit is millimeters. When the parameter value is positive, the generated path will be within the object edge; when the parameter value is negative, the generated path will be outside the object edge. The larger the positive value, the more the generated paths will shrink towards the inside of the object. Please refer to the tuning example for the application result.
Default value: 15 mm

Smooth Points

Use Gaussian Filter
Description: When the edge point cloud is jagged, this parameter is used to determine whether to use the Gaussian filter to make the edge point cloud smoother.
Default value: Unselected
Tuning recommendation: Please select this option according to the actual requirement.
Gaussian Filter Radius
Description: This parameter is used to specify the radius of the Gaussian filter. The unit is pixels.
Default value: 20 px
Tuning recommendation: It is recommended to use the default value.
Gaussian Filter Sigma
Description: This parameter is used to specify the sigma of the Gaussian filter.
Default value: 5.0000
Tuning recommendation: It is recommended to use the default value.

Special Side Erode

This parameter group is designed for special applications, and it does not need to be adjusted in general.

Find Corners

Sample Size for Corner
Description: This parameter is used to set the coefficient of the downsampling on the edge point cloud. The unit is pixels. Downsampling facilitates the detection of the corner points in the edge point cloud.
Default value: 3 px
Quality Level
Description: This parameter is used to detect the corner points of the edge point cloud. It ensures that waypoints are located in the corners no matter how large the waypoint interval is.
Default value: 0.0100
Tuning recommendation: It is recommended to use the default value.
Min Distance
Description: This parameter is used to specify the minimum distance (in pixels) between corners when detecting the corner points.
Default value: 50.0000
Max Corners
Description: This parameter is used to specify the maximum number of corners of the object.
Default value: 4
Block Size
Description: This parameter is used to specify the size of the detection area. When the corner points are not obvious enough or the edge point cloud is too smooth, you can increase the value.
Default value: 10
Use Harris Detector
Description: This parameter is used to determine whether to use Harris corner detector. Once this option is selected, you will need to set the K value.
Default value: Unselected
Tuning recommendation: In general, this option does not need to be used.

Tuning Examples

Points Sample Size

When Points Sample Size is set to 20 and 5 respectively, the waypoints in the generated pathare shown below.

For the left figure, Points Sample Size is set to 20, and the waypoints are relatively sparse; for the right figure, Points Sample Size is set to 5, and the waypoints are relatively dense.

../../../../../_images/point_sample_size.png

Erode Kernel Size

When Erode Kernel Size is set to 5 and 15 respectively, the generated pathsare shown below.

For the left figure, Erode Kernel Size is set to 5; for the right figure, Erode Kernel Size is set to 15. As the positive value increases, the generated path will shrink towards the inside of the object’s edge.

../../../../../_images/erode_kernel_size_1.png

When Erode Kernel Size is set to -5 and -20 respectively, the generated pathsare shown below.

For the left figure, Erode Kernel Size is set to -5; for the right figure, Erode Kernel Size is set to -20. As the negative value decreases, the generated path will expand towards the outside of the object’s edge.

../../../../../_images/erode_kernel_size_2.png

Vertical Move Real Dis

When Vertical Move Real Dis is set to 5 and 15 respectively, the generated pathsare shown below.

For the left figure, Vertical Move Real Dis is set to 5; for the right figure, Vertical Move Real Dis is set to 15. As the value of the positive number increases, the generated path will shrink towards the inside of the object edge.

../../../../../_images/vertical_move_real_dis_1.png

When Vertical Move Real Dis is set to -5 and -20 respectively, the generated pathsare shown below.

For the left figure, Vertical Move Real Dis is set to -5; for the right figure, Vertical Move Real Dis is set to -20. As the negative value decreases, the generated path will expand towards the outside of the object edge.

../../../../../_images/vertical_move_real_dis_2.png