Fit Circle to Profile

Description

This Step is used to fit a circle to the input profile and output various features of the fitted circle.

fit circle to profile effect

Fits a circle to the entire profile

Workflow

The process of configuring this Step is shown below.

fit circle to profile process
  1. Configure the input. Connect the Step ports in the graphical programming workspace or select the input under Input in the parameter configuration panel.

  2. Determine whether to use a feature region.

  3. Select the fitting method and set relevant parameters.

  4. Select the desired output(s) under Output. For an expandable output item, click ▶ and configure the Min and Max values of the acceptable range.

  5. Run the Step and view output.

Parameter Description

Parameter Description

Use Feature Region

When this option is selected, this Step only uses data within the feature region to fit a circle.

When this option is unselected, this Step uses the entire profile to fit a circle.

For more information on how to set and adjust the feature region, see Feature Region.

Fitting Method

This parameter specifies the method of fitting the circle to the profile.

  • Iterative robust least squares

    This method uses iterative least squares fitting to reduce the influence of outliers. When selecting this method, you need to set the Outlier Fraction parameter.

  • RANSAC

    This method uses random sampling to reduce the influence of outliers. When selecting this method, you need to set the Tolerance and Number of Iterations parameters.

In general, the iterative robust least squares method is applicable to cases where there are few outliers in the dataset, while RANSAC is applicable to cases where there are many outliers.

Outlier Fraction

This parameter defines the proportion of outliers to be removed during circle fitting, thus resulting in a better result.

Tolerance

This parameter refers to the distance threshold used in the RANSAC algorithm when determining the adequacy of a data point for fitting a model. If the distance between a data point and the fitted circle is less than or equal to the tolerance, the data point is considered an inlier, i.e., a point suitable for fitting the model, while points with a distance greater than the tolerance are considered outliers that will cause interference. By adjusting Tolerance, it is possible to control the sensitivity of the RANSAC algorithm to noise and outliers. The larger the value, the more easily the noise are recognized as inliers, and vice versa.

Default setting: 0.001 mm

Number of Iterations

In RANSAC, this parameter defines how many times the algorithm will randomly sample the data and fit a model to the sampled points.

Default value: 1000

In general, increasing the number of iterations can lead to more robust results, but this comes with the trade-off of increased computational costs.

Output Description

Select the output item(s) to add the output port(s) to the Step, and the corresponding data will be output after the Step is run. You can select the output according to the actual measurement requirements.

If you select an expandable output item, you must expand it by clicking ▶, and then set the Min and Max values to determine the acceptable range. If the output value falls within the acceptable range, the measurement item is judged as passing (OK), or else it is judged as failing (NG).

Output Item Description

Circle Center X

X value of the center of the fitted circle.

Circle Center Z

Z value of the center of the fitted circle.

Radius

The radius of the fitted circle.

Standard Deviation

The standard deviation of the data points with respect to the fitted circle.

Min Error

The minimum error of the data points with respect to the fitted circle.

Max Error

The maximum error of the data points with respect to the fitted circle.

Min Error X

The X value of the point with the minimum error.

Min Error Z

The Z value of the point with the minimum error.

Max Error X

The X value of the point with the maximum error.

Max Error Z

The Z value of the point with the maximum error.

Center of Fitted Circle

The center point of the fitted circle.

Fitted Circle

The fitted circle obtained.

Troubleshooting

  • For common errors, see Error Code List.

  • If the error code is inconsistent with the error message, please contact Technical Support for help.

CV-W5501

Error: The “Outlier Fraction” value is not within [0, 1].

Possible cause: The set outlier fraction is not within [0, 1].

Solution: Reset “Outlier Fraction” to ensure that the value is within 0-100%.

CV-W5502

Error: The number of iterations should exceed 0 when the fitting method is RANSAC.

Possible cause: The set number of iterations is not greater than 0.

Solution: Reset Number of Iterations and ensure that it exceeds 0.

CV-W5503

Error: The tolerance should exceed 0 when the fitting method is RANSAC.

Possible cause: The set tolerance is not greater than 0.

Solution: Reset Tolerance and ensure that it exceeds 0.

We Value Your Privacy

We use cookies to provide you with the best possible experience on our website. By continuing to use the site, you acknowledge that you agree to the use of cookies. If you decline, a single cookie will be used to ensure you're not tracked or remembered when you visit this website.