Read the internal camera parameters from text file.
::read_cam_par is used to read the internal camera parameters CamParam from a text file with name CamParFile.
The format of the text file is a (Halcon-independent) generic parameter description. Thus, arbitrary sets of parameters can be grouped together in a hierarchical way. The description of a single parameter within a parameter group consists of the following 3 lines:
Name : Shortname : Actual value ;
Type : Lower bound (optional) : Upper bound (optional) ;
Description (optional) ;
The Halcon operator ::write_cam_par expects in the file
CamParFile the parameter group Camera:Parameter. This
parameter group consists of the 8 parameters Focus, Sx, Sy, Cx, Cy,
Kappa , ImageWidth and ImageHeight. Comments are
marked by a '\#' at the beginning of a line. A suitable file can
look like the following:
# INTERNAL CAMERA PARAMETERS
ParGroup: Camera: Parameter;
"Internal CCD-camera parameters";
Focus:foc: 0.00806039;
DOUBLE:0.0:;
"Focal length of the lens [meter]";
Sx:sx: 1.0629e-05;
DOUBLE:0.0:;
"Width of a cell on the CCD-chip [meter]";
Sy:sy: 1.1e-05;
DOUBLE:0.0:;
"Height of a cell on the CCD-chip [meter]";
Cx:cx: 378.236;
DOUBLE:0.0:;
"X-coordinate of the image center [pixel]";
Cy:cy: 297.587;
DOUBLE:0.0:;
"Y-coordinate of the image center [pixel]";
Kappa:kappa: -2253.5;
DOUBLE::;
"Radial distortion coefficient [1/(meter*meter)]";
ImageWidth:imgw: 768;
INT:0:2048;
"Width of the used calibration images [pixel]";
ImageHeight:imgh: 576;
INT:0:2048;
"Height of the used calibration images [pixel]";
The underlying camera model is a \textbf{pinhole or telecentric
camera with radial distortions}. A detailed description of these
camera models can be found with description of
::write_cam_par.
|
CamParFile (input_control) |
string -> HTuple.char * |
| File name of internal camera parameters. | |
| Default value: 'campar.dat' | |
| List of values: 'campar.dat', 'campar.initial', 'campar.final' | |
|
CamParam (output_control) |
number-array -> HTuple.double * / long * |
| Internal camera parameters. | |
| Number of elements: 8 | |
HTuple CamParam;
// get internal camera parameters:
::read_cam_par("campar.dat",&CamParam);
::read_cam_par returns H_MSG_TRUE if all parameter values are correct and the file has been read successfully. If necessary an exception handling is raised.
::find_marks_and_pose, ::sim_caltab, ::create_caltab, ::disp_caltab, ::camera_calibration
::find_caltab, ::find_marks_and_pose, ::camera_calibration, ::disp_caltab, ::sim_caltab, ::write_cam_par, ::write_pose, ::read_pose, ::project_3d_point, ::get_line_of_sight
Camera calibration