Foundation (CVFoundation.dll) 15.0
Calibration of linescan cameras

Enumerations

enum  CVFScanDirection { CVFSD_X = 0 , CVFSD_Y = 1 }
 

Functions

cvbres_t CVFCreateLineScanCalibration (CVIPointD CalibrationPoint1, CVIPointD CalibrationPoint2, double ReferenceDistanceCalibrationPoints, int *ScanLineIndices, double *EdgeIndices, size_t NumScanLines, size_t NumEdgesPerScanLine, double ReferenceWidthStripes, const CVFLineScanCalibrationConfiguration &Configuration, NLTRANSFORMATION &Transformation, double &PixelSize, double &MeanError, double &StdDev)
 This function calibrates linescan cameras. More...
 
cvbres_t CVFDetectEdgesOfStripeTarget (IMG ImageStripes, cvbdim_t Left, cvbdim_t Top, cvbdim_t Right, cvbdim_t Bottom, size_t NumStripes, CVFScanDirection ScanDirection, double Threshold, int *ScanLineIndices, double *EdgeIndices, size_t &NumScanLines, size_t &NumEdgesPerScanLine)
 This function detects edges from a calibration pattern with alternating black and white stripes. More...
 
cvbres_t CVFGet2PointsForCalibrationOfMovement (IMG Image, cvbdim_t Index, const TArea &Aoi, TCalibrationPatternContrast Contrast, cvbval_t MinContrast, double MinPointSize, double MaxPointSize, CVFScanDirection ScanDirection, CVIPointD &FirstPoint, CVIPointD &SecondPoint)
 Extracts two points which can be used for the calibration of the movement of linescan cameras. If the image contains more than two points, the points which are nearest to the left and right edge (or top and bottom edge, if movement direction is x) are chosen. More...
 

Detailed Description

Enumeration Type Documentation

◆ CVFScanDirection

Enumeration for scanning direction of the camera.

Enumerator
CVFSD_X 

The camera scans the target in X direction (movement of the camera is Y).

CVFSD_Y 

The camera scans the target in Y direction (movement of the camera is X).

Function Documentation

◆ CVFCreateLineScanCalibration()

cvbres_t CVFCreateLineScanCalibration ( CVIPointD  CalibrationPoint1,
CVIPointD  CalibrationPoint2,
double  ReferenceDistanceCalibrationPoints,
int *  ScanLineIndices,
double *  EdgeIndices,
size_t  NumScanLines,
size_t  NumEdgesPerScanLine,
double  ReferenceWidthStripes,
const CVFLineScanCalibrationConfiguration Configuration,
NLTRANSFORMATION &  Transformation,
double &  PixelSize,
double &  MeanError,
double &  StdDev 
)

This function calibrates linescan cameras.

The transformation result includes a 3rd order polynom for the line calibration and a factor to correct the movement direction. Note, that x and y do not depend on each other. All mixed coefficients are zero.

For the calibration of the movement direction an image containing two calibration dots is needed. The pixel coordinates of the dots CalibrationPoint1 and CalibrationPoint2 are calculated by the function CVFGet2PointsForCalibrationOfMovement. CVFCreateLineScanCalibration needs these coordinates and the reference distance between the dots ReferenceDistanceCalibrationPoints.

For the linescan calibration an image of a pattern with alternating black and white stripes has to be aquired. Also, the width of the stripes ReferenceWidthStripes has to be given as reference. Function CVFDetectEdgesOfStripeTarget detects the stripes of the calibration pattern and gives their indices ScanLineIndices and EdgeIndices.

The resulting transformation can be applied to images using function CreateNLTransformedImage.

Parameters
[in]CalibrationPoint1First calibration point (left or top).
[in]CalibrationPoint2Second calibration point (right or bottom).
[in]ReferenceDistanceCalibrationPointsReference distance between the two calibration points (same units as ReferenceWidthStripes).
[in]ScanLineIndicesArray with scan line indices containing NumScanLines elements.
[in]EdgeIndicesArray with edge indicies of each scan line containing NumScanLines x NumEdgesPerScanLine elements. The indices are stored scan line by scan line consecutively.
[in]NumScanLinesNumber of scan lines.
[in]NumEdgesPerScanLineNumber of edges per scan line.
[in]ReferenceWidthStripesReference width of stripes in calbration pattern ImageStripes (same units as ReferenceDistanceCalibrationPoints).
[in]ConfigurationConfiguration of linescan calibration.
[out]TransformationHandle of result transformation object.
[out]PixelSizePixel size after transformation (same units as ReferenceDistanceCalibrationPoints and ReferenceWidthStripes).
[out]MeanErrorMean deviation of all distances between stripes of transformed image from reference stripe width.
[out]StdDevStandard deviation of MeanError.
Returns
One of the CVC_ERROR values. < 0 indicates an error.
See also
CVFGet2PointsForCalibrationOfMovement, CVFDetectEdgesOfStripeTarget, CreateNLTransformedImage

◆ CVFDetectEdgesOfStripeTarget()

cvbres_t CVFDetectEdgesOfStripeTarget ( IMG  ImageStripes,
cvbdim_t  Left,
cvbdim_t  Top,
cvbdim_t  Right,
cvbdim_t  Bottom,
size_t  NumStripes,
CVFScanDirection  ScanDirection,
double  Threshold,
int *  ScanLineIndices,
double *  EdgeIndices,
size_t &  NumScanLines,
size_t &  NumEdgesPerScanLine 
)

This function detects edges from a calibration pattern with alternating black and white stripes.

The output of this function is used by function CVFCreateLineScanCalibration calculating the linescan calibration.

For the detection of the transition between the stripes, the CVB function CFindAllEdges is used. For further information see the documentation of the CVB edge tool.

Attention
If ScanDirection is X memory of size ImageHeigh(ImageStripes)*sizeof(int) bytes has to be allocated by the caller for ScanLineIndices and ImageHeight(ImageStripes)*sizeof(double)*(NumStripes + 1) for EdgeIndices. If ScanDirection is Y use ImageWidth(ImageStripes) instead of ImageHeight(ImageStripes). The scan line indices are stored in element 0 till NumScanLines in ScanLineIndices. In EdgesIndices the edges are stored line by line consecutively, NumEdgesScanLine for each line.
Parameters
[in]ImageStripesCalibration pattern with alternating black and white stripes.
[in]LeftLeft edge of area of interest for ImageStripes.
[in]TopTop edge of area of interest for ImageStripes.
[in]RightRight edge of area of interest for ImageStripes.
[in]BottomBottom edge of area of interest for ImageStripes.
[in]NumStripesNumber of stripes in the calibration pattern.
[in]ScanDirectionScan direction of the camera.
[in]ThresholdThreshold for edge detection in ImageStripes (pixel data type dependent, see also CFindAllEdges).
[out]ScanLineIndicesArray to recive the indices of the scan lines.
[out]EdgeIndicesArray to recive the indices of edges for each scan line.
[out]NumScanLinesNumber of scan lines where edges are correctly detected.
[out]NumEdgesPerScanLineNumber of edges per scan line.
Returns
One of the CVC_ERROR values. < 0 indicates an error.
See also
CVFCreateLineScanCalibration, CVFGet2PointsForCalibrationOfMovement

◆ CVFGet2PointsForCalibrationOfMovement()

cvbres_t CVFGet2PointsForCalibrationOfMovement ( IMG  Image,
cvbdim_t  Index,
const TArea Aoi,
TCalibrationPatternContrast  Contrast,
cvbval_t  MinContrast,
double  MinPointSize,
double  MaxPointSize,
CVFScanDirection  ScanDirection,
CVIPointD FirstPoint,
CVIPointD SecondPoint 
)

Extracts two points which can be used for the calibration of the movement of linescan cameras. If the image contains more than two points, the points which are nearest to the left and right edge (or top and bottom edge, if movement direction is x) are chosen.

Parameters
[in]ImageImage containing the calibration points.
[in]IndexIndex of the plane to be processed.
[in]AoiArea of interest where the calibration points can be found.
[in]ContrastSelects whether the image shows white on black or black on white dots.
[in]MinContrastMinimum 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]MinPointSizeDesired minimum point size (in number of pixels).
[in]MaxPointSizeDesired maximum point size (in number of pixels).
[in]ScanDirectionScan direction of the camera.
[out]FirstPointX and Y coordinate of top calibration point if ScanDirection is X, otherwise left point.
[out]SecondPointX and Y coordinate of bottom calibration point if ScanDirection is X, otherwise right point.
Returns
One of the CVC_ERROR values. < 0 indicates an error.
See also
CVFCreateLineScanCalibration