Result of the linescan calibration executed by the CreateLineScanCalibration function. More...
#include <cvb/foundation/calibration_line_scan.hpp>
Public Member Functions | |
NonLinearTransformationPtr | Transformation () const noexcept |
Gets the transformation. More... | |
double | PixelSize () const noexcept |
Gets the pixel size after transformation. More... | |
double | MeanError () const noexcept |
Gets the mean difference between stripe width in the transformed image and reference. More... | |
double | StandardDeviation () const noexcept |
Gets the standard deviation of the mean error. More... | |
Friends | |
std::unique_ptr< LineScanCalibrator > | CreateLineScanCalibration (const Point2D< double > &calibrationPoint1, const Point2D< double > &calibrationPoint2, double referenceDistanceCalibrationPoints, const EdgeDetectionResult &edgeDetectionResult, double referenceWidthStripes, const LineScanCalibrationConfiguration &configuration) |
Calibrates linescan cameras. More... | |
Result of the linescan calibration executed by the CreateLineScanCalibration function.
|
inlinenoexcept |
Gets the mean difference between stripe width in the transformed image and reference.
This is calculated over all stripes.
Does | not throw any exception. |
|
inlinenoexcept |
Gets the pixel size after transformation.
The pixel size has the same units as referenceDistanceCalibrationPoints and referenceWidthStripes given within function CreateLineScanCalibration.
Does | not throw any exception. |
|
inlinenoexcept |
Gets the standard deviation of the mean error.
Does | not throw any exception. |
|
inlinenoexcept |
Gets the transformation.
The transformation object includes the coefficients of a 3rd order polynomial. Mixed coefficients are zero. Depending on the ScanDirection specified in LineScanCalibrationConfiguration, the estimated polynomial is:
Scan direction in X:
x' = a1 * x^3 + a5 * x^2 + a8 * x + a10
y' = b9 * y
Scan direction in Y:
y' = b4 * y^3 + b7 * y^2 + b9 * y + b10
x' = a8 * x
where
x: pixel position in x (column),
y: pixel position in y (row),
a1-a10: coefficients in x,
b1-b10: coefficients in y,
x' and y': transformed x and y coordinates.
Does | not throw any exception. |
|
friend |
Calibrates linescan cameras.
This function estimates coefficients of a 3rd order polynomial which calibrates linescan cameras. The polynomial corrects lens distortion as well as the camera's direction of movement (described by a scaling factor).
For the estimation of the lens distortion correction a pattern with alternating black and white stripes where the width of the stripes referenceWidthStripes is precisely known has to be acquired. For the camera's direction of movement a target with two circular markers can be used. The distance between the calibration points referenceDistanceCalibrationPoints has to be known, too. Note, that referenceWidthStripes and referenceDistanceCalibrationPoints must be provided in the same units.
In a first step the edges of the stripe target have to be detected via function DetectEdgesOfStripeTarget.
Second the two markers have to be extracted from the image via function CalculateTwoPointsForCalibrationOfMovement. Note, that if the encoder step of your setup is precisely known (e.g. in [mm/scanline]), you do not need to acquire an image with markers. You may manually define fictive calibration points and the corresponding reference distance:
[in] | calibrationPoint1 | First calibration point (left or top). |
[in] | calibrationPoint2 | Second calibration point (right or bottom). |
[in] | referenceDistanceCalibrationPoints | Reference distance between the two calibration points (same units as referenceWidthStripes). |
[in] | edgeDetectionResult | Result returned by DetectEdgesOfStripeTarget. |
[in] | referenceWidthStripes | Reference width of stripes in calibration pattern (same units as referenceDistanceCalibrationPoints). |
[in] | configuration | Configuration of linescan calibration. |