Operator Reference
create_caltab (Operator)
create_caltab
— 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 : )
Description
create_caltab
creates the description file of a standard HALCON
calibration plate with hexagonally arranged marks. This calibration plate
contains MarksPerRow
times NumRows
circular marks.
These marks are arranged in a hexagonal lattice such that each mark
(except the ones at the border) has six equidistant neighbors.
The diameter of the marks is given by the parameter Diameter
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_object
if at least one of these finder patterns
is completely visible.
The position of the central mark of each finder pattern is given in
FinderRow
and FinderColumn
. Thus, the length of the tuples
given in FinderRow
and FinderColumn
, 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, so
every mark containing a hole can be assigned to a finder pattern distinctly.
As a rule of thumb, if the calibration plate contains too few 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.
An example case is depicted below, but note that a successful
detection of the patterns also depends on the used camera setup.
The coordinate system of the calibration plate is located in the center of the central mark of the first finder pattern.
Depending on Polarity
the marks are either light on dark
background (for 'light_on_dark' , which is the default) or dark on
light background (for 'dark_on_light' ).
The file CalPlateDescr
contains the calibration plate description,
and must be passed to all HALCON operations using the generated
calibration plate (e.g., set_calib_data_calib_object
or
sim_caltab
). 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:
-
the number of row and columns of the calibration plate
-
the number of marks per row and column
-
the offset of the coordinate system to the plate's surface in z-direction
-
the rim of the calibration plate
-
the polarity of the marks
-
the number and position of finder patterns
-
the x,y coordinates and radius of the calibration marks
A file generated by create_caltab
looks like the following
(comments are marked by a '#' at the beginning of a line):
# Plate Description Version 3 # HALCON Version 20.11 -- Wed Dec 16 11:02:00 2020 # 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.170323, 0.129118 # 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 CalPlatePSFile
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 CalPlateDescr
exactly.
Thus, the coordinates of the calibration marks in the calibration
plate description file may have to be corrected!
For purchased calibration plates it is recommended to use the specific calibration description file that is supplied with your calibration plate.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
NumRows
(input_control) integer →
(integer)
Number of rows.
Default: 27
Recommended increment: 1
Restriction:
NumRows > 2
MarksPerRow
(input_control) integer →
(integer)
Number of marks per row.
Default: 31
Recommended increment: 1
Restriction:
MarksPerRow > 2
Diameter
(input_control) real →
(real)
Diameter of the marks.
Default: 0.00258065
Suggested values: 0.00258065, 0.1, 0.0125, 0.00375, 0.00125
FinderRow
(input_control) integer(-array) →
(integer)
Row indices of the finder patterns.
Default: [13,6,6,20,20]
FinderColumn
(input_control) integer(-array) →
(integer)
Column indices of the finder patterns.
Default: [15,6,24,6,24]
Polarity
(input_control) string →
(string)
Polarity of the marks
Default: 'light_on_dark'
Suggested values: 'light_on_dark' , 'dark_on_light'
CalPlateDescr
(input_control) filename.write →
(string)
File name of the calibration plate description.
Default: 'calplate.cpd'
List of values: 'calplate.cpd'
File extension:
.cpd
CalPlatePSFile
(input_control) filename.write →
(string)
File name of the PostScript file.
Default: '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_caltab
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
Alternatives
See also
find_caltab
,
find_marks_and_pose
,
camera_calibration
,
disp_caltab
,
sim_caltab
Module
Foundation