Skip to content

3D Cylinder Fitting

Operator Function

Perform cylinder fitting on the input point cloud to obtain the fitted cylinder parameters: top and bottom center coordinates and cylinder radius (for better fitting results in a relatively short time, it is recommended that the point cloud contains 1000-100000 points)

Parameter Introduction

Input Parameters

ParameterRangeDefault ValueDescriptionIllustration
Input Image0-80IM number for image input

Calculation Parameters

ParameterRangeDefault ValueDescriptionIllustration
Region2D Window/2D Circular Window/2D Polygon Window/Box/Cylindrical Box/Rotated Box/Point Set (binding only)BoxManual selection: Set the ROI region for cylinder fitting
> Note: Ensure the ROI center point is inside the circle.
Can bind to select existing ROI region
Statistical Filtertrue/falsefalseApply statistical filtering to the input point cloud
Standard Deviation Multiple Threshold0.1-100.150Input parameter n, any point exceeding n times the standard deviation from the mean will be considered an outlier and removed
Neighborhood Points3-500100Number of neighbor points to consider during filtering (this number must be less than the number of input point cloud points)
K-Nearest Neighbors3-50020When calculating the normal of a point in the point cloud, the number of surrounding points to search. If the set search number is too large, it may introduce points far from the current point, leading to inaccurate estimation; if the set value is too small, it may ignore some adjacent points, also affecting the accuracy of normal estimation.
Distance Threshold0-100000.15When the distance between a data point and the fitted model is less than this threshold, the data point is considered an inlier (i.e., a point that fits the model); otherwise, it is considered an outlier (i.e., a point that does not fit the model)
Minimum Points0Set the minimum number of points in the input point cloud
Maximum Points1000000Set the maximum number of points in the input point cloud

Note: As shown in the figure below, in the spatial coordinate system, a cylinder can be determined by the top and bottom center points and radius R.

Cylinder

Result Display

ParameterRangeDefault ValueDescriptionIllustration
Cylindertrue/falsefalseIf enabled, display the cylinder in the image
ROI Point Settrue/falsefalseOnly effective when Use Region Parameters is selected. Region point set selected by ROI box. If enabled, display in the image

Output Parameters

NameTypeRangeDescription
Resultbooltrue/falsetrue for success
false for failure
Warningbooltrue/falsetrue indicates a warning
false indicates no warning
MessagestringOutput success, error, or warning messages. Empty if no error or warning.
TimefloatOperator execution time, unit: ms
cylindercylinderOutput cylinder

Tip

For more detailed explanations of parameter types, please refer to Type Definitions

Exception Troubleshooting

No.Exception InformationCorresponding ParameterSolution
1Input region type is {0}, invalid region typeRegion TypeRegion input type must be one of: 2D Window/2D Circular Window/2D Polygon Window/Box/Cylindrical Box/Rotated Box/Point Set
2Region is empty1. Check if selection is empty
2. Check if point set is empty
3Input point cloud is emptyConfirm if IM contains valid points. If no valid points, load point cloud or switch to IM with valid points
4Filter parameters are invalidAdjust statistical filter parameters
5Point limit is invalidSet the upper limit of point cloud to be less than the actual point cloud size
6Input point cloud count exceeds limitAdjust point limit range or replace with point cloud that meets the limit
7Input polygon vertex count is less than 3, cannot form polygonAdd 2D polygon window vertices so that vertex count is at least three

Example Introduction

Engineering Design

  1. Select the Load Point Cloud tool to load the required 3D point cloud image to IM0.

  2. Select the 3D Cylinder Fitting tool.

Tool Usage

  1. Select the input image for the operation. The image number must match the IM number where the image is located in the project.

  2. Select the region type as Box, move the box to the position to be measured, enclosing the point cloud area to be tested.

Usage Tips

  1. Use the ROI controller on the image window to drag or scale the box;
  2. Directly modify the box's start or end point coordinates in the calculation parameters to adjust the box position and size;
  1. Set the parameters.

  2. Check the content you want to display in the result display section.

  3. Click Test to check if the image window and parameters meet expectations.

  4. If there are no issues, click Save. Run the operator in the run list, and then view the running results in the corresponding IM.

Local Image

AI-Vision, Making 3D Measurement Easier