Skip to content

cam_par_to_cam_matcam_par_to_cam_matCamParToCamMatCamParToCamMatcam_par_to_cam_matT_cam_par_to_cam_mat🔗

Short description🔗

cam_par_to_cam_matcam_par_to_cam_matCamParToCamMatCamParToCamMatcam_par_to_cam_matT_cam_par_to_cam_mat — Compute a camera matrix from internal camera parameters.

Signature🔗

cam_par_to_cam_mat( campar CameraParam, out hom_mat2d CameraMatrix, out extent.x ImageWidth, out extent.y ImageHeight )cam_par_to_cam_mat( : : CameraParam : CameraMatrix, ImageWidth, ImageHeight )void CamParToCamMat( const HTuple& CameraParam, HTuple* CameraMatrix, HTuple* ImageWidth, HTuple* ImageHeight )static void HOperatorSet.CamParToCamMat( HTuple cameraParam, out HTuple cameraMatrix, out HTuple imageWidth, out HTuple imageHeight )def cam_par_to_cam_mat( camera_param: Sequence[Union[int, float, str]] ) -> Tuple[Sequence[float], int, int]

Herror T_cam_par_to_cam_mat( const Htuple CameraParam, Htuple* CameraMatrix, Htuple* ImageWidth, Htuple* ImageHeight )

HHomMat2D HCamPar::CamParToCamMat( Hlong* ImageWidth, Hlong* ImageHeight ) const

void HHomMat2D::CamParToCamMat( const HCamPar& CameraParam, Hlong* ImageWidth, Hlong* ImageHeight )

HHomMat2D HCamPar.CamParToCamMat( out int imageWidth, out int imageHeight )

void HHomMat2D.CamParToCamMat( HCamPar cameraParam, out int imageWidth, out int imageHeight )

Description🔗

cam_par_to_cam_matCamParToCamMat computes the camera matrix CameraMatrixcameraMatrixcamera_matrix as well as the image width ImageWidthimageWidthimage_width, and the image height ImageHeightimageHeightimage_height from the internal camera parameters CameraParamcameraParamcamera_param. The internal camera parameters CameraParamcameraParamcamera_param can be determined with camera_calibrationCameraCalibration. cam_par_to_cam_matCamParToCamMat converts this representation of the internal camera parameters into the representation used by stationary_camera_self_calibrationStationaryCameraSelfCalibration. The conversion can only be performed if the camera is an area scan pinhole camera and the distortion coefficients in CameraParamcameraParamcamera_param are 0. If necessary, change_radial_distortion_cam_parChangeRadialDistortionCamPar must be used to set the distortion coefficients to 0.

Execution information🔗

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🔗

CameraParamcameraParamcamera_param (input_control) campar → (real / integer / string)(real / integer / string)HTuple (double / Hlong / HString)HCamPar, HTuple (double / int / long / string)Sequence[Union[int, float, str]]Htuple (double / Hlong / char*)

Internal camera parameters.

CameraMatrixcameraMatrixcamera_matrix (output_control) hom_mat2d → (real)(real)HTuple (double)HHomMat2D, HTuple (double)Sequence[float]Htuple (double)

3x3 projective camera matrix that corresponds to CameraParamcameraParamcamera_param.

ImageWidthimageWidthimage_width (output_control) extent.x → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of the images that correspond to CameraMatrixcameraMatrixcamera_matrix.

Assertion: ImageWidth > 0

ImageHeightimageHeightimage_height (output_control) extent.y → (integer)(integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of the images that correspond to CameraMatrixcameraMatrixcamera_matrix.

Assertion: ImageHeight > 0

Example🔗

(HDevelop)


* For the input data to calibrate_cameras, please refer to the
* example for calibrate_cameras.
calibrate_cameras (CalibDataID, Error)
get_calib_data (CalibDataID, 'camera', 0, 'params', CameraParam)
cam_par_to_cam_mat (CameraParam, CameraMatrix, ImageWidth, ImageHeight)

* Alternatively, the following calls can be used.
change_radial_distortion_cam_par ('adaptive', CameraParam, 0, CamParamOut)
cam_par_to_cam_mat (CamParamOut, CameraMatrix, ImageWidth, ImageHeight)

Result🔗

If the parameters are valid, the operator cam_par_to_cam_matCamParToCamMat returns the value 2 (H_MSG_TRUE). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

camera_calibrationCameraCalibration

See also

stationary_camera_self_calibrationStationaryCameraSelfCalibration, cam_mat_to_cam_parCamMatToCamPar

Module🔗

Calibration