sim_caltab ( : SimImage : CalTabDescrFile, CamParam, CaltabPose, GrayBackground, GrayCaltab, GrayMarks, ScaleFac : )

Simulate an image with calibration plate.

sim_caltab is used to generate a simulated calibration image. The calibration plate description is read from the file CalTabDescrFile and will be projected into the image plane using the given camera parameters (interior camera parameters CamParam and exterior camera parameters CaltabPose), see also project_3d_point.

In the simulated image only the calibration plate is shown. The image background is set to the gray value GrayBackground, the calibration plate background is set to GrayCaltab, and the calibration marks are set to the gray value GrayMarks. The parameter ScaleFac influences the number of supporting points to approximate the elliptic contours of the calibration marks, see also disp_caltab. Increasing the number of supporting points causes a more accurate determination of the mark boundary, but increases the computation time, too. For each pixel of the simulated image, which touches a subpixel-boundary of this kind, the gray value is set linearly between GrayMarks and GrayCaltab dependent on the proportion Inside/Outside.

By applying the operator sim_caltab you can generate synthetic calibration images (with known camera parameters!) to test the quality of the calibration algorithm (see camera_calibration).


Parameters

SimImage (output_object)
image -> object : byte
Simulated calibration image.

CalTabDescrFile (input_control)
string -> string
File name of the calibration plate description.
Default value: 'caltab.descr'

CamParam (input_control)
number-array -> real / integer
Interior camera parameters.
Number of elements: 8

CaltabPose (input_control)
pose-array -> real / integer
Exterior camera parameters (3D pose of the calibration plate in camera coordinates).
Number of elements: 7

GrayBackground (input_control)
integer -> integer
Gray value of image background.
Default value: 128
Suggested values: 0, 32, 64, 96, 128, 160
Restriction: (0 <= GrayBackground) <= 255

GrayCaltab (input_control)
integer -> integer
Gray value of calibration plate.
Default value: 224
Suggested values: 144, 160, 176, 192, 208, 224, 240
Restriction: (0 <= GrayCaltab) <= 255

GrayMarks (input_control)
integer -> integer
Gray value of calibration marks.
Default value: 80
Suggested values: 16, 32, 48, 64, 80, 96, 112
Restriction: (0 <= GrayMarks) <= 255

ScaleFac (input_control)
real -> real
Scaling factor to reduce oversampling.
Default value: 1.0
Suggested values: 1.0, 0.5, 0.25, 0.125
Recommended increment: 0.05
Restriction: 1.0 >= ScaleFac


Example
* read calibration image
read_image(Image1, 'calib-01') 
*  find calibration pattern
find_caltab(Image1, Caltab1, 'caltab.descr', 3, 112, 5) 
* find calibration marks and initial pose
StartCamPar := [Focus, Kappa, Sx, Sy, Cx, Cy, ImageWidth, ImageHeight]
find_marks_and_pose(Image1, Caltab1, 'caltab.descr', StartCamPar,
                    128 ,10, 18, 0.9, 15.0, 100.0, RCoord1, CCoord1,
                    StartPose1) 
*  read 3D positions of calibration marks 
caltab_points('caltab.descr', NX, NY, NZ) 
*  camera calibration 
camera_calibration(NX, NY, NZ, RCoord1, CCoord1, StartCamPar,
                   StartPose1, 11, CamParam, FinalPose, Errors) 
*  simulate calibration image
sim_caltab(Image1Sim, 'caltab.descr', CamParam, FinalPose, 128, 224, 80, 1)

Result

sim_caltab returns 2 (H_MSG_TRUE) if all parameter values are correct. If necessary, an exception handling is raised.


Parallelization Information

sim_caltab is processed under mutual exclusion against itself and without parallelization.


Possible Predecessors

camera_calibration, find_marks_and_pose, read_pose, read_cam_par, hom_mat3d_to_pose


Possible Successors

find_caltab


See also

find_caltab, find_marks_and_pose, camera_calibration, disp_caltab, create_pose, hom_mat3d_to_pose, project_3d_point, create_caltab


Module

Camera calibration



Copyright © 1996-2005 MVTec Software GmbH