Operator Reference

write_cam_parT_write_cam_parWriteCamParWriteCamParwrite_cam_par (Operator)

write_cam_parT_write_cam_parWriteCamParWriteCamParwrite_cam_par — Write internal camera parameters into a file.

Signature

write_cam_par( : : CameraParam, CamParFile : )

Herror T_write_cam_par(const Htuple CameraParam, const Htuple CamParFile)

void WriteCamPar(const HTuple& CameraParam, const HTuple& CamParFile)

void HCamPar::WriteCamPar(const HString& CamParFile) const

void HCamPar::WriteCamPar(const char* CamParFile) const

void HCamPar::WriteCamPar(const wchar_t* CamParFile) const   ( Windows only)

static void HOperatorSet.WriteCamPar(HTuple cameraParam, HTuple camParFile)

void HCamPar.WriteCamPar(string camParFile)

def write_cam_par(camera_param: Sequence[Union[int, float, str]], cam_par_file: str) -> None

Description

write_cam_parwrite_cam_parWriteCamParWriteCamParwrite_cam_par stores the internal camera parameters CameraParamCameraParamCameraParamcameraParamcamera_param into a file specified by its file name CamParFileCamParFileCamParFilecamParFilecam_par_file.

The number of values in CameraParamCameraParamCameraParamcameraParamcamera_param depends on the specified camera type. See the description of set_calib_data_cam_paramset_calib_data_cam_paramSetCalibDataCamParamSetCalibDataCamParamset_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_parReadCamParReadCamParread_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

CameraParamCameraParamCameraParamcameraParamcamera_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.

CamParFileCamParFileCamParFilecamParFilecam_par_file (input_control)  filename.write HTuplestrHTupleHtuple (string) (string) (HString) (char*)

File name of internal camera parameters.

Default: 'campar.dat' "campar.dat" "campar.dat" "campar.dat" "campar.dat"

List of values: 'campar.dat'"campar.dat""campar.dat""campar.dat""campar.dat", 'campar.final'"campar.final""campar.final""campar.final""campar.final", '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_parWriteCamParWriteCamParwrite_cam_par returns 2 ( H_MSG_TRUE) if all parameter values are correct and the file has been written successfully. If necessary an exception is raised.

Possible Predecessors

camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationcamera_calibration

See also

find_caltabfind_caltabFindCaltabFindCaltabfind_caltab, find_marks_and_posefind_marks_and_poseFindMarksAndPoseFindMarksAndPosefind_marks_and_pose, camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationcamera_calibration, disp_caltabdisp_caltabDispCaltabDispCaltabdisp_caltab, sim_caltabsim_caltabSimCaltabSimCaltabsim_caltab, read_cam_parread_cam_parReadCamParReadCamParread_cam_par, write_posewrite_poseWritePoseWritePosewrite_pose, read_poseread_poseReadPoseReadPoseread_pose, project_3d_pointproject_3d_pointProject3dPointProject3dPointproject_3d_point, get_line_of_sightget_line_of_sightGetLineOfSightGetLineOfSightget_line_of_sight

Module

Foundation