CVB.Net 14.0
CalibrationPattern Class Reference

Methods for CVB calibration pattern handling. More...

Static Public Member Functions

static Image Create (CalibrationPatternStyle style, CalibrationPatternContrast contrast, int width, int height, int numColumns, int numRows)
 Create a user-definable calibration pattern. More...
 
static Image Create (CalibrationPatternStyle style, CalibrationPatternContrast contrast, CalibrationPatternFormat paperSize, CalibrationPatternOrientation orientation, int numColumns, int numRows, double horizontalBorder, double verticalBorder, int dpi)
 Create a user-definable calibration pattern suitable for printing on a sheet of paper. The calibration pattern will consist of a regularly spaced matrix of dots, the size of which will be determined by the input parameters. The size of the pattern image will be suitable for printing it on an piece of paper defined by the paperSize parameter. The calibration pattern will consist of a regular rectangular grid of dots. The distance between the dots in x- and y-direction will be 2.5 times the diameter of the dots. If an asymmetric pattern was selected, the bigger dots will have 2.5 times the area of the smaller dots (meaning that their radius is sqrt(2.5) times the radius of the small dots). More...
 
static void ExtractCalibrationLists (ImagePlane plane, CalibrationPatternStyle style, CalibrationPatternContrast contrast, int gridSpacing, int minContrast, double maxRatio, out Point2Dd[] originalPixels, out Point2Dd[] transformedPixels)
 Automatically extracts the pixel lists required for creating a NonLinearTransformation object. More...
 
static void ExtractCalibrationLists (ImagePlane plane, Area2D aoi, CalibrationPatternStyle style, CalibrationPatternContrast contrast, int gridSpacing, int minContrast, double maxRatio, out Point2Dd[] originalPixels, out Point2Dd[] transformedPixels)
 Automatically extracts the pixel lists required for creating a NonLinearTransformation object. More...
 

Detailed Description

Methods for CVB calibration pattern handling.

Member Function Documentation

◆ Create() [1/2]

static Image Create ( CalibrationPatternStyle  style,
CalibrationPatternContrast  contrast,
CalibrationPatternFormat  paperSize,
CalibrationPatternOrientation  orientation,
int  numColumns,
int  numRows,
double  horizontalBorder,
double  verticalBorder,
int  dpi 
)
static

Create a user-definable calibration pattern suitable for printing on a sheet of paper. The calibration pattern will consist of a regularly spaced matrix of dots, the size of which will be determined by the input parameters. The size of the pattern image will be suitable for printing it on an piece of paper defined by the paperSize parameter. The calibration pattern will consist of a regular rectangular grid of dots. The distance between the dots in x- and y-direction will be 2.5 times the diameter of the dots. If an asymmetric pattern was selected, the bigger dots will have 2.5 times the area of the smaller dots (meaning that their radius is sqrt(2.5) times the radius of the small dots).

Parameters
styleDot style to use (see CalibrationPatternStyle).
contrastSelects whether to use white on black or black on white dots (see CalibrationPatternContrast).
paperSizesize of the paper on which to print the calibration pattern later on (see CalibrationPatternFormat).
orientationChoose orientation; only relevant for CalibrationPatternStyle.AsymmetricDots.
numColumnsNumber of dot columns in the image.
numRowsNumber of dot rows in the image.
horizontalBorderHorizontal borders to be applied (in inches).This value should match the setting that is going to be used for printing the resulting image. Must not be negative. The meaning of horizontal refers to the paper size definition and is independent of the orientation setting.
verticalBorderVertical borders to be applied (in inches).This value should match the setting that is going to be used for printing the resulting image. Must not be negative. The meaning of vertical refers to the paper size definition and is independent of the orientation setting.
dpiDot density to be used (in dots per inch).It usually makes sense to set this parameter to the printer's physical dot density or half or quarter of that. Minimum value is 150.
Returns
Calibration pattern image.

◆ Create() [2/2]

static Image Create ( CalibrationPatternStyle  style,
CalibrationPatternContrast  contrast,
int  width,
int  height,
int  numColumns,
int  numRows 
)
static

Create a user-definable calibration pattern.

The calibration pattern will consist of a regular spaced matrix of dots, the size of which will be determined by the input parameters. The distance between the dots in x- and y-direction will be 2.5 times the diameter of the dots.

If an asymmetric pattern was selected, the bigger dots will have 2.5 times the area of the smaller dots (meaning that their radius is sqrt(2.5) times the radius of the small dots).

Parameters
styleDot style to use (see CalibrationPatternStyle).
contrastSelects whether to use white on black or black on white dots (see CalibrationPatternContrast).
widthWidth of the output image in pixels.
heightHeight of the output image in pixels.
numColumnsNumber of dot columns in the image.
numRowsNumber of dot rows in the image.
Returns
Calibration pattern image.

◆ ExtractCalibrationLists() [1/2]

static void ExtractCalibrationLists ( ImagePlane  plane,
Area2D  aoi,
CalibrationPatternStyle  style,
CalibrationPatternContrast  contrast,
int  gridSpacing,
int  minContrast,
double  maxRatio,
out Point2Dd[]  originalPixels,
out Point2Dd[]  transformedPixels 
)
static

Automatically extracts the pixel lists required for creating a NonLinearTransformation object.

Note that a more convenient alternative is to call the method NonLinearTransformation.FromCalibrationPattern. It will do the list extraction and the generation of the transformation object in a single function call.

The image plane given to this method needs to contain a calibration pattern as generated by the method CalibrationPattern.Create(CalibrationPatternStyle, CalibrationPatternContrast, int, int, int, int): A regularly spaced matrix of dots, the distance between the dots in x- and y-direction should be 2.5 times the diameter of the dots, if an asymmetric pattern was used, the bigger dots should have 2.5 times the area of the smaller dots (meaning that their radius is sqrt(2.5) times the radius of the small dots).

Note that, although the area of interest is given as a Area2D here (and in the processing of the Area2D the image's coordinate system will be respected), the actual output of this method uses CoordinateSystemType.PixelCoordinates! This seemingly inconsistent mix in this case is in fact useful, because a Area2D will better capture the actual location of a calibration pattern, especially if the image has been rotated, than a Rect style area of interest. But the calibration functions usually assume that the pixel lists are given in pixel coordinates.

To avoid misunderstandings and complications in the interpretation of the image content, it is recommended to use a default coordinate system on the input image.

Parameters
planeImage plane to work on.
aoiArea of interest in which to look for the calibration pattern's dots.
styleCalibration pattern style visible in the image. (see CalibrationPatternStyle)
contrastSelects whether the image shows CalibrationPatternContrast.BlackOnWhite or CalibrationPatternContrast.WhiteOnBlack dots.
gridSpacingSpacing of the calibration dot grid in the target image.Defines the distance of the points that will end up in the transformedPixels list.
minContrastMinimum gray value contrast between the object and the background of the calibration target pattern. Value to be set depends on the quality of the image taken from the pattern, but in a typical situation this contrast should not drop below 64 gray values, otherwise it might become difficult to extract the calibration points.
maxRatioMaximum ratio between the biggest and the smallest calibration dot.This value will be used to identify outliers when looking for calibration dots. It should be set high enough to allow for the area variations to be expected due to perspective distortions and small enough to eliminate the candidates that are either too big or too small to be valid calibration pattern dots. Typically, values of about 3.0 to 5.0 are big enough - even if there is notable perspective distortion visible in the images. If an asymmetric calibration pattern has been selected, the ratio used for calculation will be adapted accordingly.
originalPixelsPoint list to contain the locations of the calibration dots in the input image in pixel coordinates.
transformedPixelsPixel list to contain the appropriate locations of the calibration dots in the target image of the calibration.

◆ ExtractCalibrationLists() [2/2]

static void ExtractCalibrationLists ( ImagePlane  plane,
CalibrationPatternStyle  style,
CalibrationPatternContrast  contrast,
int  gridSpacing,
int  minContrast,
double  maxRatio,
out Point2Dd[]  originalPixels,
out Point2Dd[]  transformedPixels 
)
static

Automatically extracts the pixel lists required for creating a NonLinearTransformation object.

Note that a more convenient alternative is to call the method NonLinearTransformation.FromCalibrationPattern. It will do the list extraction and the generation of the transformation object in a single function call.

The image plane given to this method needs to contain a calibration pattern as generated by the method CalibrationPattern.Create(CalibrationPatternStyle, CalibrationPatternContrast, int, int, int, int): A regularly spaced matrix of dots, the distance between the dots in x- and y-direction should be 2.5 times the diameter of the dots, if an asymmetric pattern was used, the bigger dots should have 2.5 times the area of the smaller dots (meaning that their radius is sqrt(2.5) times the radius of the small dots).

Note that, although the area of interest is given as a Area2D here (and in the processing of the Area2D the image's coordinate system will be respected), the actual output of this method uses CoordinateSystemType.PixelCoordinates! This seemingly inconsistent mix in this case is in fact useful, because a Area2D will better capture the actual location of a calibration pattern, especially if the image has been rotated, than a Rect style area of interest. But the calibration functions usually assume that the pixel lists are given in pixel coordinates.

To avoid misunderstandings and complications in the interpretation of the image content, it is recommended to use a default coordinate system on the input image.

Parameters
planeImage plane to work on.
styleCalibration pattern style visible in the image. (see CalibrationPatternStyle)
contrastSelects whether the image shows CalibrationPatternContrast.BlackOnWhite or CalibrationPatternContrast.WhiteOnBlack dots.
gridSpacingSpacing of the calibration dot grid in the target image.Defines the distance of the points that will end up in the transformedPixels list.
minContrastMinimum gray value contrast between the object and the background of the calibration target pattern. Value to be set depends on the quality of the image taken from the pattern, but in a typical situation this contrast should not drop below 64 gray values, otherwise it might become difficult to extract the calibration points.
maxRatioMaximum ratio between the biggest and the smallest calibration dot.This value will be used to identify outliers when looking for calibration dots. It should be set high enough to allow for the area variations to be expected due to perspective distortions and small enough to eliminate the candidates that are either too big or too small to be valid calibration pattern dots. Typically, values of about 3.0 to 5.0 are big enough - even if there is notable perspective distortion visible in the images. If an asymmetric calibration pattern has been selected, the ratio used for calculation will be adapted accordingly.
originalPixelsPoint list to contain the locations of the calibration dots in the input image in pixel coordinates.
transformedPixelsPixel list to contain the appropriate locations of the calibration dots in the target image of the calibration.