ClassesClasses | | Operators

create_caltabcreate_caltabCreateCaltabCreateCaltab (Operator)

Name

create_caltabcreate_caltabCreateCaltabCreateCaltab — Generate a calibration plate description file and a corresponding PostScript file for a calibration plate with hexagonally arranged marks.

Signature

create_caltab( : : NumRows, MarksPerRow, Diameter, FinderRow, FinderColumn, Polarity, CalPlateDescr, CalPlatePSFile : )

Herror create_caltab(const Hlong NumRows, const Hlong MarksPerRow, double Diameter, const Hlong FinderRow, const Hlong FinderColumn, const char* Polarity, const char* CalPlateDescr, const char* CalPlatePSFile)

Herror T_create_caltab(const Htuple NumRows, const Htuple MarksPerRow, const Htuple Diameter, const Htuple FinderRow, const Htuple FinderColumn, const Htuple Polarity, const Htuple CalPlateDescr, const Htuple CalPlatePSFile)

void CreateCaltab(const HTuple& NumRows, const HTuple& MarksPerRow, const HTuple& Diameter, const HTuple& FinderRow, const HTuple& FinderColumn, const HTuple& Polarity, const HTuple& CalPlateDescr, const HTuple& CalPlatePSFile)

static void HMisc::CreateCaltab(Hlong NumRows, Hlong MarksPerRow, double Diameter, const HTuple& FinderRow, const HTuple& FinderColumn, const HString& Polarity, const HString& CalPlateDescr, const HString& CalPlatePSFile)

static void HMisc::CreateCaltab(Hlong NumRows, Hlong MarksPerRow, double Diameter, Hlong FinderRow, Hlong FinderColumn, const HString& Polarity, const HString& CalPlateDescr, const HString& CalPlatePSFile)

static void HMisc::CreateCaltab(Hlong NumRows, Hlong MarksPerRow, double Diameter, Hlong FinderRow, Hlong FinderColumn, const char* Polarity, const char* CalPlateDescr, const char* CalPlatePSFile)

static void HOperatorSet.CreateCaltab(HTuple numRows, HTuple marksPerRow, HTuple diameter, HTuple finderRow, HTuple finderColumn, HTuple polarity, HTuple calPlateDescr, HTuple calPlatePSFile)

static void HMisc.CreateCaltab(int numRows, int marksPerRow, double diameter, HTuple finderRow, HTuple finderColumn, string polarity, string calPlateDescr, string calPlatePSFile)

static void HMisc.CreateCaltab(int numRows, int marksPerRow, double diameter, int finderRow, int finderColumn, string polarity, string calPlateDescr, string calPlatePSFile)

Description

create_caltabcreate_caltabCreateCaltabCreateCaltabCreateCaltab creates the description file of a standard HALCON calibration plate with hexagonally arranged marks. This calibration plate contains MarksPerRowMarksPerRowMarksPerRowMarksPerRowmarksPerRow times NumRowsNumRowsNumRowsNumRowsnumRows circular marks. These marks are arranged in a hexagonal lattice such that each mark (except the ones at the border) has six equidistant neighbors.

image/svg+xml
A standard HALCON calibration plate with hexagonally arranged marks and its coordinate system

The diameter of the marks is given by the parameter DiameterDiameterDiameterDiameterdiameter in meters. The distance between the centers of horizontally neighboring calibration marks is given by . The distance between neighboring rows of calibration marks is given by . The width and the height of the generated calibration plate can be calculated with the following equations:

The calibration plate contains one to five finder patterns. A finder pattern is a special mark hexagon (i.e. a mark and its six neighbors) where either four or six marks contain a hole. Each of these up to five finder patterns is unique such that it can be used to determine the orientation of the calibration plate and the position of the finder pattern on the calibration plate. As a consequence, the calibration plate can only be found by find_calib_objectfind_calib_objectFindCalibObjectFindCalibObjectFindCalibObject if at least one of these finder patterns is completely visible. The position of the central mark of each finder pattern is given in FinderRowFinderRowFinderRowFinderRowfinderRow and FinderColumnFinderColumnFinderColumnFinderColumnfinderColumn. Thus, the length of the tuples given in FinderRowFinderRowFinderRowFinderRowfinderRow and FinderColumnFinderColumnFinderColumnFinderColumnfinderColumn, respectively determine the number of finder patterns on the calibration plate. Be aware that two finder patterns must not overlap. It is recommended to keep a certain distance between the finder patterns. As a rule of thumb, if the calibration plate contains too little marks to place all finder patterns in distinct positions, it is better to reduce the number of finder patterns so that they can be distributed more evenly.

The coordinate system of the calibration plate is located at the center of the central mark of the first finder pattern.

Depending on PolarityPolarityPolarityPolaritypolarity the marks are either light on dark background (for 'light_on_dark'"light_on_dark""light_on_dark""light_on_dark""light_on_dark", which is the default) or dark on light background (for 'dark_on_light'"dark_on_light""dark_on_light""dark_on_light""dark_on_light").

The file CalPlateDescrCalPlateDescrCalPlateDescrCalPlateDescrcalPlateDescr contains the calibration plate description, and must be passed to all HALCON operations using the generated calibration plate (e.g. set_calib_data_calib_objectset_calib_data_calib_objectSetCalibDataCalibObjectSetCalibDataCalibObjectSetCalibDataCalibObject or sim_caltabsim_caltabSimCaltabSimCaltabSimCaltab). The default HALCON file extension for the description of a calibration plate with hexagonally arranged marks is 'cpd'.

A calibration plate description file contains information about:

A file generated by create_caltabcreate_caltabCreateCaltabCreateCaltabCreateCaltab looks like the following (comments are marked by a '#' at the beginning of a line):

# Plate Description Version 3
# HALCON Version 12.0 --  Tue Aug 12 15:40:14 2014
# Description of the standard calibration plate
# used for the camera calibration in HALCON
# (generated by create_caltab)
#
#

# 27 rows x 31 columns
# Width, height of calibration plate [meter]: 0.167742, 0.125846
# Distance between mark centers [meter]: 0.0051613

# Number of marks in y-dimension (rows)
r 27

# Number of marks in x-dimension (columns)
c 31

# offset of coordinate system in z-dimension [meter] (optional):
z 0

# rim of the calibration plate (min x, max y, max x, min y) [meter]:
o -0.083871125 0.0645592449151841 0.086451775 -0.0645592449151841

# polarity of the marks (light or dark):
p light

# number of finder pattern marks:
f 5

# position of the finder patterns (central mark):  x y [index]
15 13
6 6
24 6
6 20
24 20

# calibration marks:  x y radius [meter]

# calibration marks at y = -0.0581076 m
-0.07483885 -0.0581076199151841 0.001290325
-0.06967755 -0.0581076199151841 0.001290325
-0.06451625 -0.0581076199151841 0.001290325
-0.05935495 -0.0581076199151841 0.001290325
-0.05419365 -0.0581076199151841 0.001290325
-0.04903235 -0.0581076199151841 0.001290325
-0.04387105 -0.0581076199151841 0.001290325
-0.03870975 -0.0581076199151841 0.001290325
-0.03354845 -0.0581076199151841 0.001290325
-0.02838715 -0.0581076199151841 0.001290325
-0.02322585 -0.0581076199151841 0.001290325
-0.01806455 -0.0581076199151841 0.001290325
-0.01290325 -0.0581076199151841 0.001290325
-0.00774195 -0.0581076199151841 0.001290325
-0.00258065 -0.0581076199151841 0.001290325
0.00258065 -0.0581076199151841 0.001290325
0.00774195 -0.0581076199151841 0.001290325
0.01290325 -0.0581076199151841 0.001290325
0.01806455 -0.0581076199151841 0.001290325
0.02322585 -0.0581076199151841 0.001290325
0.02838715 -0.0581076199151841 0.001290325
0.03354845 -0.0581076199151841 0.001290325
0.03870975 -0.0581076199151841 0.001290325
0.04387105 -0.0581076199151841 0.001290325
0.04903235 -0.0581076199151841 0.001290325
0.05419365 -0.0581076199151841 0.001290325
0.05935495 -0.0581076199151841 0.001290325
0.06451625 -0.0581076199151841 0.001290325
0.06967755 -0.0581076199151841 0.001290325
0.07483885 -0.0581076199151841 0.001290325
0.08000015 -0.0581076199151841 0.001290325

# calibration marks at y = -0.0536378 m
-0.0774195 -0.0536378029986315 0.001290325
-0.0722582 -0.0536378029986315 0.001290325
-0.0670969 -0.0536378029986315 0.001290325
-0.0619356 -0.0536378029986315 0.001290325
-0.0567743 -0.0536378029986315 0.001290325
-0.051613 -0.0536378029986315 0.001290325
-0.0464517 -0.0536378029986315 0.001290325
-0.0412904 -0.0536378029986315 0.001290325
-0.0361291 -0.0536378029986315 0.001290325
-0.0309678 -0.0536378029986315 0.001290325
-0.0258065 -0.0536378029986315 0.001290325
-0.0206452 -0.0536378029986315 0.001290325
-0.0154839 -0.0536378029986315 0.001290325
-0.0103226 -0.0536378029986315 0.001290325
-0.0051613 -0.0536378029986315 0.001290325
0 -0.0536378029986315 0.001290325
0.0051613 -0.0536378029986315 0.001290325
0.0103226 -0.0536378029986315 0.001290325
0.0154839 -0.0536378029986315 0.001290325
0.0206452 -0.0536378029986315 0.001290325
0.0258065 -0.0536378029986315 0.001290325
0.0309678 -0.0536378029986315 0.001290325
0.0361291 -0.0536378029986315 0.001290325
0.0412904 -0.0536378029986315 0.001290325
0.0464517 -0.0536378029986315 0.001290325
0.051613 -0.0536378029986315 0.001290325
0.0567743 -0.0536378029986315 0.001290325
0.0619356 -0.0536378029986315 0.001290325
0.0670969 -0.0536378029986315 0.001290325
0.0722582 -0.0536378029986315 0.001290325
0.0774195 -0.0536378029986315 0.001290325

# calibration marks at y = -0.049168 m
...

# calibration marks at y = -0.0446982 m
...

# calibration marks at y = -0.0402284 m
...

# calibration marks at y = -0.0357585 m
...

# calibration marks at y = -0.0312887 m
...

# calibration marks at y = -0.0268189 m
...

# calibration marks at y = -0.0223491 m
...

# calibration marks at y = -0.0178793 m
...

# calibration marks at y = -0.0134095 m
...

# calibration marks at y = -0.00893963 m
...

# calibration marks at y = -0.00446982 m
...

# calibration marks at y = 0 m
...

# calibration marks at y = 0.00446982 m
...

# calibration marks at y = 0.00893963 m
...

# calibration marks at y = 0.0134095 m
...

# calibration marks at y = 0.0178793 m
...

# calibration marks at y = 0.0223491 m
...

# calibration marks at y = 0.0268189 m
...

# calibration marks at y = 0.0312887 m
...

# calibration marks at y = 0.0357585 m
...

# calibration marks at y = 0.0402284 m
...

# calibration marks at y = 0.0446982 m
...

# calibration marks at y = 0.049168 m
...

# calibration marks at y = 0.0536378 m
...

# calibration marks at y = 0.0581076 m
...

Note that only the coordinates and radius of the marks in the first two rows are listed completely. The corresponding coordinates and radius of the marks in the other rows are omitted for a better overview.

The file CalPlatePSFileCalPlatePSFileCalPlatePSFileCalPlatePSFilecalPlatePSFile contains the corresponding PostScript description of the calibration plate, which can be used to print the calibration plate.

Attention

Depending on the accuracy of the used output device (e.g., laser printer), a printed calibration plate may not match the values in the calibration plate description file CalPlateDescrCalPlateDescrCalPlateDescrCalPlateDescrcalPlateDescr exactly. Thus, the coordinates of the calibration marks in the calibration plate description file may have to be corrected!

Execution Information

Parameters

NumRowsNumRowsNumRowsNumRowsnumRows (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of rows.

Default value: 27

Recommended increment: 1

Restriction: NumRows > 2

MarksPerRowMarksPerRowMarksPerRowMarksPerRowmarksPerRow (input_control)  integer HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Number of marks per row.

Default value: 31

Recommended increment: 1

Restriction: MarksPerRow > 2

DiameterDiameterDiameterDiameterdiameter (input_control)  real HTupleHTupleHtuple (real) (double) (double) (double)

Diameter of the marks.

Default value: 0.00258065

Suggested values: 0.00258065, 0.1, 0.0125, 0.00375, 0.00125

FinderRowFinderRowFinderRowFinderRowfinderRow (input_control)  integer(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Row indices of the finder patterns.

Default value: [13,6,6,20,20]

FinderColumnFinderColumnFinderColumnFinderColumnfinderColumn (input_control)  integer(-array) HTupleHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Column indices of the finder patterns.

Default value: [15,6,24,6,24]

PolarityPolarityPolarityPolaritypolarity (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (char*)

Polarity of the marks

Default value: 'light_on_dark' "light_on_dark" "light_on_dark" "light_on_dark" "light_on_dark"

Suggested values: 'light_on_dark'"light_on_dark""light_on_dark""light_on_dark""light_on_dark", 'dark_on_light'"dark_on_light""dark_on_light""dark_on_light""dark_on_light"

CalPlateDescrCalPlateDescrCalPlateDescrCalPlateDescrcalPlateDescr (input_control)  filename.write HTupleHTupleHtuple (string) (string) (HString) (char*)

File name of the calibration plate description.

Default value: 'calplate.cpd' "calplate.cpd" "calplate.cpd" "calplate.cpd" "calplate.cpd"

List of values: 'calplate.cpd'"calplate.cpd""calplate.cpd""calplate.cpd""calplate.cpd"

File extension: .cpd

CalPlatePSFileCalPlatePSFileCalPlatePSFileCalPlatePSFilecalPlatePSFile (input_control)  filename.write HTupleHTupleHtuple (string) (string) (HString) (char*)

File name of the PostScript file.

Default value: 'calplate.ps' "calplate.ps" "calplate.ps" "calplate.ps" "calplate.ps"

File extension: .ps

Example (HDevelop)

* Parameters to create the descriptor for the 160mm wide calibration
* plate.
create_caltab (27, 31, 0.00258065, [13, 6, 6, 20, 20], [15, 6, 24, 6, 24], \
              'light_on_dark', 'calplate.cpd', 'caltab.ps')

Result

create_caltabcreate_caltabCreateCaltabCreateCaltabCreateCaltab returns 2 (H_MSG_TRUE) if all parameter values are correct and both files have been written successfully. If necessary, an exception is raised.

Possible Successors

read_cam_parread_cam_parReadCamParReadCamParReadCamPar, caltab_pointscaltab_pointsCaltabPointsCaltabPointsCaltabPoints

Alternatives

gen_caltabgen_caltabGenCaltabGenCaltabGenCaltab

See also

find_caltabfind_caltabFindCaltabFindCaltabFindCaltab, find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPose, camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibration, disp_caltabdisp_caltabDispCaltabDispCaltabDispCaltab, sim_caltabsim_caltabSimCaltabSimCaltabSimCaltab

Module

Foundation


ClassesClasses | | Operators