Herror ::disp_caltab (
    const HTuple &WindowHandle,
    const HTuple &CalTabDescrFile,
    const HTuple &CamParam,
    const HTuple &CamPose,
    const HTuple &ScaleFac
)
void HWindow::DispCaltab (
    const HTuple &CalTabDescrFile,
    const HTuple &CamParam,
    const HTuple &CamPose,
    const HTuple &ScaleFac
) const

Project and visualize the 3D model of the calibration table in the image.

::disp_caltab is used to visualize the calibration marks and the connecting lines between the marks of the used calibration table (CalTabDescrFile) in the actual output window. Thus, the 3D model of the calibration table is projected into the image plane using the internal camera parameters (CamParam) and the camera pose (external camera parameters (CamPose). The underlying camera model (pinhole camera with radial distortion) is described in ::write_cam_par.

Typically ::disp_caltab is used to verificate the result of the camera calibration (see ::camera_calibration) by superimposing it onto the original image. The actual linewidth can be set by ::set_line_width, the actual color can be set by ::set_color.

The parameter ScaleFac influences the number of supporting points to approximate the elliptic contours of the calibration marks. You should increase the number of supporting points, if the image part in the actual output window is displayed with magnification (see ::set_part).


Parameters

WindowHandle (input_control)
window -> HTuple.long
Window_id.

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

CamParam (input_control)
number-array -> HTuple.double / long
Internal camera parameters.
Number of elements: 8

CamPose (input_control)
pose-array -> HTuple.double / long
External camera parameters.
Number of elements: 7

ScaleFac (input_control)
real -> HTuple.double
Scaling factor for the visualization.
Default value: 1.0
Suggested values: 0.5, 1.0, 2.0, 3.0
Recommended increment: 0.05
Restriction: 0.0 < ScaleFac


Example
HTuple StartCamPar,NX,NY,NZ;
HTuple RCoord1,CCoord1,StartPose1;
HTuple StartPose,CamParam,FinalPose,Errors;
// read calibration image
HImage Image1("calib-01.tiff");
// find calibration pattern
HRegion Caltab1 = Image1.FindCaltab("caltab.descr",3,112,5);
// find calibration marks and start pose
StartCamPar[7] = 576;          // ImageHeight
StartCamPar[6] = 768;          // ImageWidth
StartCamPar[5] = 288;          // Cy
StartCamPar[4] = 384;          // Cx
StartCamPar[3] = 0.000011;     // Sy
StartCamPar[2] = 0.000011;     // Sx
StartCamPar[1] = 0.0;          // Kappa
StartCamPar[0] = 0.008;        // Focus
RCoord1 = Image1.FindMarksAndPose(Caltab1,"caltab.descr",StartCamPar,
                                  128,10,&CCoord1,&StartPose);
// read 3D positions of calibration marks
::caltab_points("caltab.descr",&NX,&NY,&NZ);
// camera calibration
::camera_calibration(NX,NY,NZ,RCoord1,CCoord1,StartCamPar,StartPose,
                     11,&CamParam,&FinalPose,&Errors);
// visualize calibration result
::disp_image(Image1,WindowHandle);
::set_color(WindowHandle,"red");
::disp_caltab("caltab.descr",CamParam,FinalPose,1.0);

Result

::disp_caltab returns H_MSG_TRUE if all parameter values are correct. If necessary, an exception handling is raised.


Possible Predecessors

::camera_calibration, ::read_cam_par, ::read_pose


See also

::find_marks_and_pose, ::camera_calibration, ::sim_caltab, ::write_cam_par, ::read_cam_par, ::create_pose, ::write_pose, ::read_pose, ::project_3d_point, ::get_line_of_sight


Module

Camera calibration



Copyright © 1996-2002 MVTec Software GmbH