gen_caltab — 为带有矩形排列标记的标定板生成标定板描述文件和相应的 PostScript 文件。
gen_caltab( : : XNum, YNum, MarkDist, DiameterRatio, CalPlateDescr, CalPlatePSFile : )
gen_caltab generates the description of a standard HALCON
calibration plate with rectangularly arranged marks. This calibration plate
consists of XNum times YNum black circular marks on a white
plane which are surrounded by a black frame.
The marks are arranged in a rectangular grid with YNum and
XNum equidistant rows and columns. The distances between these rows
and columns defines the parameter MarkDist in meter. The marks'
diameter can be set by the parameter DiameterRatio and is defined by
the equation .
Using a distance between marks of 0.01 m and a diameter ratio of 0.5, the width
of the dark surrounding frame becomes 8 cm, and the radius of the marks is set
to 2.5 mm. The coordinate system of the calibration plate is located in the
barycenter of all marks, its z-axis points into the calibration plate, its
x-axis to the right, and its y-axis downwards.
The black frame of the calibration plate encloses a triangular black orientation mark in the top left corner to uniquely determine the position of the calibration plate. The width and the height of the generated calibration plate can be calculated with the following equations:
The file CalPlateDescr contains the calibration plate description,
e.g., the number of rows and columns of the calibration plate, the geometry
of the surrounding frame (see find_caltab), the triangular
orientation mark, an offset of the coordinate system to the plate's surface
in z-direction, and the x,y coordinates and the radius of all calibration
plate marks given in the calibration plate coordinate system. The definition
of the orientation and the offset, indicated by t and z, is optional and can
be commented out. The default HALCON file extension for the calibration
plate description is 'descr'. A file generated by gen_caltab looks
like the following (comments are marked by a '#' at the beginning of a
line):
# Plate Description Version 2
# HALCON Version 7.1 -- Fri Jun 24 16:41:00 2005
# Description of the standard calibration plate
# used for the camera calibration in HALCON
# (generated by gen_caltab)
#
#
# 7 rows x 7 columns
# Width, height of the black frame [meter]: 0.1, 0.1
# Distance between mark centers [meter]: 0.0125
# Number of marks in y-dimension (rows)
r 7
# Number of marks in x-dimension (columns)
c 7
# offset of coordinate system in z-dimension [meter] (optional):
z 0
# Rectangular border (rim and black frame) of calibration plate
# rim of the calibration plate (min x, max y, max x, min y) [meter]:
o -0.05125 0.05125 0.05125 -0.05125
# outer border of the black frame (min x, max y, max x, min y) [meter]:
i -0.05 0.05 0.05 -0.05
# triangular corner mark given by two corner points (x,y, x,y) [meter]
# (optional):
t -0.05 -0.0375 -0.0375 -0.05
# width of the black frame [meter]:
w 0.003125
# calibration marks: x y radius [meter]
# calibration marks at y = -0.0375 m
-0.0375 -0.0375 0.003125
-0.025 -0.0375 0.003125
-0.0125 -0.0375 0.003125
-3.46945e-018 -0.0375 0.003125
0.0125 -0.0375 0.003125
0.025 -0.0375 0.003125
0.0375 -0.0375 0.003125
# calibration marks at y = -0.025 m
-0.0375 -0.025 0.003125
-0.025 -0.025 0.003125
-0.0125 -0.025 0.003125
-3.46945e-018 -0.025 0.003125
0.0125 -0.025 0.003125
0.025 -0.025 0.003125
0.0375 -0.025 0.003125
# calibration marks at y = -0.0125 m
-0.0375 -0.0125 0.003125
-0.025 -0.0125 0.003125
-0.0125 -0.0125 0.003125
-3.46945e-018 -0.0125 0.003125
0.0125 -0.0125 0.003125
0.025 -0.0125 0.003125
0.0375 -0.0125 0.003125
# calibration marks at y = -3.46945e-018 m
-0.0375 -3.46945e-018 0.003125
-0.025 -3.46945e-018 0.003125
-0.0125 -3.46945e-018 0.003125
-3.46945e-018 -3.46945e-018 0.003125
0.0125 -3.46945e-018 0.003125
0.025 -3.46945e-018 0.003125
0.0375 -3.46945e-018 0.003125
# calibration marks at y = 0.0125 m
-0.0375 0.0125 0.003125
-0.025 0.0125 0.003125
-0.0125 0.0125 0.003125
-3.46945e-018 0.0125 0.003125
0.0125 0.0125 0.003125
0.025 0.0125 0.003125
0.0375 0.0125 0.003125
# calibration marks at y = 0.025 m
-0.0375 0.025 0.003125
-0.025 0.025 0.003125
-0.0125 0.025 0.003125
-3.46945e-018 0.025 0.003125
0.0125 0.025 0.003125
0.025 0.025 0.003125
0.0375 0.025 0.003125
# calibration marks at y = 0.0375 m
-0.0375 0.0375 0.003125
-0.025 0.0375 0.003125
-0.0125 0.0375 0.003125
-3.46945e-018 0.0375 0.003125
0.0125 0.0375 0.003125
0.025 0.0375 0.003125
0.0375 0.0375 0.003125
The file CalPlatePSFile contains the corresponding
PostScript description of the calibration plate.
Depending on the accuracy of the used output device (e.g., laser printer),
the 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!
XNum (输入控制) integer → (integer)
Number of marks in x direction.
默认值: 7
建议值: 5, 7, 9
建议增量: 1
限制:
XNum > 1
YNum (输入控制) integer → (integer)
Number of marks in y direction.
默认值: 7
建议值: 5, 7, 9
建议增量: 1
限制:
YNum > 1
MarkDist (输入控制) real → (real)
Distance of the marks in meters.
默认值: 0.0125
建议值: 0.1, 0.0125, 0.00375, 0.00125
限制:
0.0 < MarkDist
DiameterRatio (输入控制) real → (real)
Ratio of the mark diameter to the mark distance.
默认值: 0.5
建议值: 0.5, 0.55, 0.6, 0.65
限制:
0.0 < DiameterRatio < 1.0
CalPlateDescr (输入控制) filename.write → (string)
File name of the calibration plate description.
默认值: 'caltab.descr'
值列表: 'caltab.descr'
File extension:
.descr
CalPlatePSFile (输入控制) filename.write → (string)
File name of the PostScript file.
默认值: 'caltab.ps'
File extension:
.ps
* Create calibration plate with width = 80 cm. gen_caltab( 7, 7, 0.1, 0.5, 'caltab.descr', 'caltab.ps')
gen_caltab returns 2 (
H_MSG_TRUE)
if all parameter values are
correct and both files have been written successfully。如有必要,则抛出异常。
find_caltab,
find_marks_and_pose,
camera_calibration,
disp_caltab,
sim_caltab
基础