Namespace for collection of calibration linescan functions from the Foundation package.
More...
|
std::pair< Point2D< double >, Point2D< double > > | CalculateTwoPointsForCalibrationOfMovement (const ImagePlane &imagePlane, const Area2D &aoi, Foundation::Transform2D::CalibrationPatternContrast contrast, int minContrast, const ValueRange< double > &pointSizeRange, const ScanDirection &scanDirection) |
| Extracts two points which can be used for the calibration of the movement of linescan cameras.
|
|
EdgeDetectionResult | DetectEdgesOfStripeTarget (const Image &imageStripes, const Rect< int > &aoi, int numStripes, const ScanDirection &scanDirection, double threshold) |
| This function detects edges from a calibration pattern with alternating black and white stripes.
|
|
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.
|
|
Namespace for collection of calibration linescan functions from the Foundation package.
- Online Manual
- Calibration of Linescan Cameras
◆ PreDefinedPixelSizeMode
Specifies if the predefined pixel resolution is used for the metric calibration.
Enumerator |
---|
DoNotUse | Predefined pixel resolution will not be used.
|
Use | Predefined pixel resolution will be used.
|
◆ ScanDirection
◆ CalculateTwoPointsForCalibrationOfMovement()
Extracts two points which can be used for the calibration of the movement of linescan cameras.
The output of this function serves as input for the linescan calibration process executed by the CreateLineScanCalibration function.
If the image contains more than two points, the points which are nearest to the top and bottom edge (or left and right edge if ScanDirection is Y) are chosen.
- Parameters
-
[in] | imagePlane | An image plane containing the calibration points. |
[in] | aoi | Area of interest where the calibration points can be found. |
[in] | contrast | Selects whether the image shows white on black or black on white dots. |
[in] | minContrast | Minimum gray value contrast between the object and the background of the calibration points. Value to be set depends on the quality of the image taken. |
[in] | pointSizeRange | The minimum and maximum size of the markers in the image in [number of pixels]. |
[in] | scanDirection | Scan direction of the camera. |
- Returns
- first: X and Y coordinate of top calibration point if the ScanDirection is X, otherwise left point.
second: X and Y coordinate of bottom calibration point if the ScanDirection is X, otherwise right point.
- Exceptions
-
◆ CreateLineScanCalibration()
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:
double encoderStep = ...
referenceDistanceCalibrationPoints = encoderStep;
Multi-purpose 2D vector class.
Definition point_2d.hpp:20
- Parameters
-
[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. |
- Returns
- A linescan calibrator including a transformation and its quality.
◆ DetectEdgesOfStripeTarget()
This function detects edges from a calibration pattern with alternating black and white stripes.
The output of this function is used by function CreateLineScanCalibration calculating the linescan calibration. This function internally calls Edge::FindAllEdges, where all input parameter are described, too. For detailed information see the documentation of the CVB edge tool.
Note, that the given area of interest aoi must only cover areas with stripes.
- Note
- The given number of stripes numStripes is only used for memory allocation. It does not necessarily have to precisely match the number of stripes, but it must be equal to or greater than the actual number of stripes. If the selected value is too low, an error is thrown ("bad allocation").
- Parameters
-
[in] | imageStripes | Calibration pattern with alternating black and white stripes. |
[in] | aoi | Area of interest in the given image. |
[in] | numStripes | Number of stripes in the calibration pattern. |
[in] | scanDirection | Scan direction of the camera. |
[in] | threshold | Threshold for gray value change. |
- Returns
- Result of the edge detection.