Fit Segment
Use this tool to fit a segment to points. At least two points are necessary to fit a segment.
You may either draw the points into the image by using the available region of interest (ROI) buttons or you can connect the parameter "Points" to an appropriate ROI result of a previous tool. In case ROIs different than point ROIs are used, the respective center points of the ROIs are used for the fitting. The fitted segment is instantly displayed as soon as two points are inserted.
This tool can handle calibration information. If the result of a previous tool is connected and used as parameter, possible calibration information contained in the connected result can also be processed. This means that the results of this tool may contain calibration information, e.g., in case the connected parameter represents a distance in pixel, it will be transformed into a distance in world using the calibration information. However, the measurement will only be processed with the calibration information if all processed parameters contain calibration information, else the results are returned without calibration information.
Parameters
Basic Parameters
Image:
This parameter represents the input image in which the segment is fitted.
Points:
This parameter defines the point region(s) of interest (ROIs) to which the segment is fitted. By default no ROI is defined. To define the points, you either have to connect the parameter to an appropriate ROI result of a previous tool or you have to draw new ROIs into the image using the available ROI buttons. It is not possible to connect ROI results of multiple tools.
At least two points are necessary to fit a circle. In case a different ROI than a point ROI is transmitted or drawn, the respective center point is used.
Additional Parameters
Fitting Method:
This parameter defines the method that is used to fit the segment to the points. It is set to "tukey" by default. If you want to change the "Fitting Method", select your preferred method at the corresponding connector.
|
Value |
Description |
|---|---|
|
regression |
This method is a standard fitting method. The points are weighted (least squares) for the approximation to the fitted segment. Use this method if you want to use a fitting method that ignores outliers. |
|
huber |
This method is based on the approach of Huber. The points are weighted (least squares) for the approximation to the fitted segment. Outliers are weighted linearly and still have a small influence. Use this method, if you want to use a fitting method that decreases the impact of outliers by a linear weighting of the outliers. |
|
tukey |
This method is based on the approach of Tukey. The points are weighted (least squares) for the approximation to the fitted segment. Use this method, if you want to use a fitting method that decreases the impact of outliers by removing them before the approximation is performed. |
|
gauss |
This method is based on the approach of Gauss. The points are weighted (least squares) for the approximation to the fitted segment. The impact of outliers is decreased based on the mean value and the standard deviation of the distances of all points from the fitted segment. |
|
ignore outliers |
This method is similar to "regression". The points are weighted (least squares) for the approximation to the fitted segment. The outliers are eliminated. In particular, all points further away from the segment than the mean distance are ignored for the fitting. |
Results
Basic Results
Segment:
This result returns the graphical representation of the segment that has been fitted to the points. The result is returned as a segment ROI.
Orientation:
This result returns the angle between the fitted segment and the virtual horizontal line through the center point of the segment. It is measured counterclockwise in degrees and returned as a real number.
Score:
This result returns a numeric value that indicates how accurate the fitting was performed. The result is returned as a real number between 0 and 1. If the "Score" has the value 1, the segment is fitted with an accuracy of 100% to the points and all points have the same distance to the fitted segment.
Tool State:
"Tool State" returns information about the state of the tool and thus can be used for error handling. For more information, see Tool State Result
Additional Results
Processing Time:
This result returns the duration of the most recent execution of the tool in milliseconds. The result is provided as additional result. Therefore, it is hidden by default but it can be displayed via the button beside the tool results. For more information see the section Processing Time in the tool reference overview.