write_cam_parT_write_cam_parWriteCamParWriteCamParwrite_cam_par (Operator)
Name
write_cam_parT_write_cam_parWriteCamParWriteCamParwrite_cam_par
— Write internal camera parameters into a file.
Signature
Description
write_cam_parwrite_cam_parWriteCamParWriteCamParWriteCamParwrite_cam_par
stores the internal camera parameters
CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param
into a file specified by its file name
CamParFileCamParFileCamParFileCamParFilecamParFilecam_par_file
.
The number of values in CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param
depends on the
specified camera type. See the description of
set_calib_data_cam_paramset_calib_data_cam_paramSetCalibDataCamParamSetCalibDataCamParamSetCalibDataCamParamset_calib_data_cam_param
for a list of values and the chapter
Calibration for details on camera types and camera
parameters.
The default HALCON file extension for the camera parameters is
'dat'.
The internal camera parameters can be later read with
read_cam_parread_cam_parReadCamParReadCamParReadCamParread_cam_par
.
Execution Information
- Multithreading type: reentrant (runs in parallel with non-exclusive operators).
- Multithreading scope: global (may be called from any thread).
- Processed without parallelization.
Parameters
CameraParamCameraParamCameraParamCameraParamcameraParamcamera_param
(input_control) campar →
HCamPar, HTupleSequence[Union[int, float, str]]HTupleHtuple (real / integer / string) (double / int / long / string) (double / Hlong / HString) (double / Hlong / char*)
Internal camera parameters.
CamParFileCamParFileCamParFileCamParFilecamParFilecam_par_file
(input_control) filename.write →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
File name of internal camera parameters.
Default value:
'campar.dat'
"campar.dat"
"campar.dat"
"campar.dat"
"campar.dat"
"campar.dat"
List of values: 'campar.dat'"campar.dat""campar.dat""campar.dat""campar.dat""campar.dat", 'campar.final'"campar.final""campar.final""campar.final""campar.final""campar.final", 'campar.initial'"campar.initial""campar.initial""campar.initial""campar.initial""campar.initial"
File extension: .dat
Example (HDevelop)
*
* Calibrate the camera.
*
StartCamPar := ['area_scan_division', 0.016, 0, 0.0000074, 0.0000074, \
326, 247, 652, 494]
create_calib_data ('calibration_object', 1, 1, CalibDataID)
set_calib_data_cam_param (CalibDataID, 0, [], StartCamPar)
set_calib_data_calib_object (CalibDataID, 0, 'caltab_30mm.descr')
NumImages := 10
for I := 1 to NumImages by 1
read_image (Image, '3d_machine_vision/calib/calib_' + I$'02d')
find_calib_object (Image, CalibDataID, 0, 0, I, [], [])
get_calib_data_observ_contours (Caltab, CalibDataID, 'caltab', 0, 0, I)
endfor
calibrate_cameras (CalibDataID, Error)
get_calib_data (CalibDataID, 'camera', 0, 'params', CamParam)
* Write the internal camera parameters to a file.
write_cam_par (CamParam, 'camera_parameters.dat')
Result
write_cam_parwrite_cam_parWriteCamParWriteCamParWriteCamParwrite_cam_par
returns TRUE if all parameter values are
correct and the file has been written successfully. If necessary an
exception is raised.
Possible Predecessors
camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration
See also
find_caltabfind_caltabFindCaltabFindCaltabFindCaltabfind_caltab
,
find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose
,
camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationCameraCalibrationcamera_calibration
,
disp_caltabdisp_caltabDispCaltabDispCaltabDispCaltabdisp_caltab
,
sim_caltabsim_caltabSimCaltabSimCaltabSimCaltabsim_caltab
,
read_cam_parread_cam_parReadCamParReadCamParReadCamParread_cam_par
,
write_posewrite_poseWritePoseWritePoseWritePosewrite_pose
,
read_poseread_poseReadPoseReadPoseReadPoseread_pose
,
project_3d_pointproject_3d_pointProject3dPointProject3dPointProject3dPointproject_3d_point
,
get_line_of_sightget_line_of_sightGetLineOfSightGetLineOfSightGetLineOfSightget_line_of_sight
Module
Foundation