Fit Line to Profile

Description

This Step is used to fit a line to the input profile and measure the deviations from the fitted line.

line fitting illustration

Fits a line to the entire profile

Workflow

The process of configuring this Step is shown below.

fit line 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. Select Feature Region Mode.

  3. Set relevant parameters according to the selected mode.

  4. Select the desired output items under Output. For an expandable output item, click ▶ and configure the Min and Max values to determine the acceptable range for the item.

  5. Run the Step and view output.

Parameter Description

Parameter Description

Feature Region Mode

This parameter determines the regions for line fitting and measurement.

  • None mode: Use the entire profile input into the Step for line fitting and measurement.

  • Combined mode: A feature region should be set for line fitting and measurement.

  • Separated mode: Regions are set for line fitting and measurement separately. Up to two feature regions can be set for line fitting.

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

Fitting Method

This parameter specifies the method for fitting a line to the profile.

  • Simple: A fast line fitting method. The fitted line is roughly accurate.

  • Robust: An iterative line fitting method. The fitted line is accurate, but it takes a long time to fit the line. When selecting this method, you need to set the Outlier Fraction parameter.

Outlier Fraction

This parameter is used to set the proportion of outliers to be removed during line fitting so as to best fit a line. The default value is 30%.

Measurements Percentage

This parameter is used to set the percentage of data points with the smallest errors considered when evaluating the error from the data points to the fitted line. The default value is 50%.

Once the Error at Percentile option is selected in the Output section, the Step will output the error value at the percentile corresponding to the percentage set here, that is, the maximum error corresponding to a point within the set “Measurements Percentage.”

“Percentile” is a statistical concept usually used to represent a position in the dataset. After sorting a set of data in ascending order, you can use the percentile to describe the value at a specific percentage.

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

Standard Deviation

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

Min Error

The minimum error of the data points from the fitted line.

Max Error

The maximum error of the data points from the fitted line.

Error at Percentile

The maximum error of points within “Measurements Percentage” from the fitted line.

Offset

The Z value of the intersection of the fitted line with the Z-axis.

Angle

The angle of the fitted line with respect to the X-axis.

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.

Arithmetic Mean

The mean of the distances from the data points to the fitted line.

Error Range

The range of errors of the data points from the fitted line.

Fitted Line

The best fitted line.

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-W5601

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, 1].

CV-W5602

Error: The “Measurements Percentage” value should be within [0, 1].

Possible cause: The set measurements percentage is not within [0, 1].

Solution: Reset Measurements Percentage to ensure that the value is within [0, 1].

CV-W5603

Error: Data points in the region for measurement are insufficient.

Possible cause: Data points are not included in the region for measurement.

Solution: Check and adjust the region for measurement to ensure that data points are included.

CV-W5604

Error: Data points in the region for line fitting are insufficient.

Possible cause: The number of points in the region for line fitting is less than 2.

Solution: Check and adjust the region for line fitting to ensure that the number of points in it is no less than 2.

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.