Result of the function DetectEdgesOfStripeTarget. More...
#include <cvb/foundation/calibration_line_scan.hpp>
Public Member Functions | |
std::vector< int > | ScanLineIndices () const noexcept |
Gets the indices of the scan lines. More... | |
std::vector< double > | EdgeIndices () const noexcept |
Gets the indices of edges for each scan line. More... | |
int | NumProfiles () const noexcept |
Gets the number of scan lines where edges are correctly detected. More... | |
int | NumEdgesPerProfile () const noexcept |
Gets the number of edges per profile (scan line). 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 function DetectEdgesOfStripeTarget.
The DetectEdgesOfStripeTarget function identifies edges within an image depicting a target with alternating black and white stripes. The image is scanned line by line and the results, including edge indices and scan lines are stored within this class.
Subsequently, the instance of this class serves as input for the linescan calibration process executed by the CreateLineScanCalibration function.
|
inlinenoexcept |
Gets the indices of edges for each scan line.
Note, that the size of the returned vector does not represent the actual dimensions. The size depends on the allocated memory determined by the image height and the given number of stripes given in function DetectEdgesOfStripeTarget. The edge indices are stored subsequently scan line by scan line. Only values up to elements with index #NumEdgesPerProfile*#NumProfiles-1
are valid.
The following code snippet prints ScanLineIndices and EdgeIndices in a more readable format:
Does | not throw any exception. |
|
inlinenoexcept |
Gets the number of edges per profile (scan line).
Does | not throw any exception. |
|
inlinenoexcept |
Gets the number of scan lines where edges are correctly detected.
Note, that only profiles, where the same number of edges are found, are stored to EdgeDetectionResult.
Does | not throw any exception. |
|
inlinenoexcept |
Gets the indices of the scan lines.
Note, that the size of the returned vector does not represent the actual number of indices. The size depends on the allocated memory determined by the image height given in function DetectEdgesOfStripeTarget. Only values up to elements with index #NumProfiles-1
are valid.
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. |