Skip to content

change_radial_distortion_cam_parchange_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamParchange_radial_distortion_cam_parT_change_radial_distortion_cam_par🔗

Short description🔗

change_radial_distortion_cam_parchange_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamParchange_radial_distortion_cam_parT_change_radial_distortion_cam_par — Determine new camera parameters in accordance to the specified radial distortion.

Signature🔗

change_radial_distortion_cam_par( string Mode, campar CamParamIn, real DistortionCoeffs, out campar CamParamOut )change_radial_distortion_cam_par( : : Mode, CamParamIn, DistortionCoeffs : CamParamOut )void ChangeRadialDistortionCamPar( const HTuple& Mode, const HTuple& CamParamIn, const HTuple& DistortionCoeffs, HTuple* CamParamOut )static void HOperatorSet.ChangeRadialDistortionCamPar( HTuple mode, HTuple camParamIn, HTuple distortionCoeffs, out HTuple camParamOut )def change_radial_distortion_cam_par( mode: str, cam_param_in: Sequence[Union[int, float, str]], distortion_coeffs: MaybeSequence[Union[float, int]] ) -> Sequence[Union[int, float, str]]

Herror T_change_radial_distortion_cam_par( const Htuple Mode, const Htuple CamParamIn, const Htuple DistortionCoeffs, Htuple* CamParamOut )

HCamPar HCamPar::ChangeRadialDistortionCamPar( const HString& Mode, const HTuple& DistortionCoeffs ) const

HCamPar HCamPar::ChangeRadialDistortionCamPar( const HString& Mode, double DistortionCoeffs ) const

HCamPar HCamPar::ChangeRadialDistortionCamPar( const char* Mode, double DistortionCoeffs ) const

HCamPar HCamPar::ChangeRadialDistortionCamPar( const wchar_t* Mode, double DistortionCoeffs ) const (Windows only)

HCamPar HCamPar.ChangeRadialDistortionCamPar( string mode, HTuple distortionCoeffs )

HCamPar HCamPar.ChangeRadialDistortionCamPar( string mode, double distortionCoeffs )

Description🔗

change_radial_distortion_cam_parChangeRadialDistortionCamPar modifies the internal camera parameters in accordance to the specified radial distortion coefficients DistortionCoeffsdistortionCoeffsdistortion_coeffs. The operator can only be used for area scan cameras (with any lens type) and for line scan cameras with telecentric lenses. Line scan cameras with perspective lenses are not supported.

With the parameter Modemodemode, one of the following modes can be selected:

  • 'fixed'"fixed": Only the distortion coefficients are modified, the other internal camera parameters remain unchanged. In general, this leads to a change of the visible part of the scene.

  • 'fullsize'"fullsize": For area scan cameras, the scale factors \(S_{x}\) and\(S_{y}\) and the image center point \((C_{x},C_{y})^T\) are modified in order to preserve the visible part of the scene. For line scan cameras with telecentric lenses, the scale factor \(S_{x}\), the image center point \((C_{x},C_{y})^T\), and the \(V_{y}\) component of the motion vector are changed to achieve the this effect. Thus, all points visible in the original image are also visible in the modified (rectified) image. In general, this leads to undefined pixels in the modified image.

  • 'adaptive'"adaptive": A trade-off between the other modes: The visible part of the scene is slightly reduced to prevent undefined pixels in the modified image. The same parameters as for 'fullsize'"fullsize" are modified.

  • 'preserve_resolution'"preserve_resolution": As in the mode 'fullsize'"fullsize", all points visible in the original image are also visible in the modified (rectified) image. For area scan cameras, the scale factors \(S_{x}\) and \(S_{y}\) and the image center point \((C_{x},C_{y})^T\) are modified. For line scan cameras with telecentric lenses, the scale factor \(S_{x}\), the image center point \((C_{x},C_{y})^T\), and potentially the \(V_{y}\) component of the motion vector are changed to achieve the this effect. In general, this leads to undefined pixels in the modified image. In contrast to the mode 'fullsize'"fullsize", additionally the size of the modified image is increased such that the image resolution does not decrease in any part of the image.

In all modes, the distortion coefficients in CamParamOutcamParamOutcam_param_out are set to DistortionCoeffsdistortionCoeffsdistortion_coeffs. For telecentric line scan cameras, the motion vector also influences the perceived distortion. For example, a nonzero \(V_{x}\) component leads to skewed pixels. Furthermore, if \(V_{y} \ne S_{x} / \mbox{Magnification}\), the pixels appear to be non-square. Therefore, for telecentric line scan cameras, up to three more components can be passed in addition to \(\kappa\) or \((K_{1}, K_{2}, K_{3}, P_{1}, P_{2})\), respectively, in DistortionCoeffsdistortionCoeffsdistortion_coeffs. These specify the new \(V_{x}\), \(V_{y}\), and \(V_{z}\) components of the motion vector.

The transformation of a pixel in the modified image into the image plane using CamParamOutcamParamOutcam_param_out results in the same point as the transformation of a pixel in the original image via CamParamIncamParamIncam_param_in.

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🔗

Modemodemode (input_control) string → (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Mode

Default: 'adaptive'"adaptive"
Suggested values: 'fullsize', 'adaptive', 'fixed', 'preserve_resolution'"fullsize", "adaptive", "fixed", "preserve_resolution"

CamParamIncamParamIncam_param_in (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 (original).

DistortionCoeffsdistortionCoeffsdistortion_coeffs (input_control) real(-array) → (real / integer)(real / integer)HTuple (double / Hlong)HTuple (double / int / long)MaybeSequence[Union[float, int]]Htuple (double / Hlong)

Desired radial distortions.

Number of elements: DistortionCoeffs == 1 || DistortionCoeffs == 5
Default: 0.00.0

CamParamOutcamParamOutcam_param_out (output_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 (modified).

Result🔗

change_radial_distortion_cam_parChangeRadialDistortionCamPar returns 2 (H_MSG_TRUE) if all parameter values are correct. If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

camera_calibrationCameraCalibration, read_cam_parReadCamPar

Possible successors

change_radial_distortion_imageChangeRadialDistortionImage, change_radial_distortion_contours_xldChangeRadialDistortionContoursXld, gen_radial_distortion_mapGenRadialDistortionMap

See also

camera_calibrationCameraCalibration, read_cam_parReadCamPar, change_radial_distortion_imageChangeRadialDistortionImage, change_radial_distortion_contours_xldChangeRadialDistortionContoursXld, change_radial_distortion_pointsChangeRadialDistortionPoints

Module🔗

Calibration