Read the mark center points from the calibration table description file.
::caltab_points is used to read the mark center points from the calibration table description file CalTabDescrFile. The mark center points are 3D coodinates in the calibration table coordinate system und describe the 3D model of the calibration table. The application of the operator ::camera_calibration projects these model points into the image. By minimizing the distance between the projected model points and the observed 2D coordinates in the image (see ::find_marks_and_pose) the exact values for the internal and external camera parameters are computed.
|
CalTabDescrFile (input_control) |
string -> HTuple.char * |
| File name of the calibration table description. | |
| Default value: 'caltab.descr' | |
|
X (output_control) |
real-array -> HTuple.double * |
| X-coordinates of the mark center points. | |
|
Y (output_control) |
real-array -> HTuple.double * |
| Y-coordinates of the mark center points. | |
|
Z (output_control) |
real-array -> HTuple.double * |
| Z-coordinates of the mark center points. | |
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);
::caltab_points returns H_MSG_TRUE if all parameter values are correct and the file CalTabDescrFile has been read successfully. If necessary, an exception handling is raised.
::find_caltab, ::find_marks_and_pose, ::camera_calibration, ::disp_caltab, ::sim_caltab, ::project_3d_point, ::get_line_of_sight, ::create_caltab
Camera calibration