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. More...
|
|
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. More...
|
|
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...
|
|
Namespace for collection of calibration linescan functions from the Foundation package.
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;
- 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.
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.