Operator Reference

change_radial_distortion_cam_parT_change_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamParchange_radial_distortion_cam_par (Operator)

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

Signature

change_radial_distortion_cam_par( : : Mode, CamParamIn, DistortionCoeffs : CamParamOut)

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

void ChangeRadialDistortionCamPar(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)

static void HOperatorSet.ChangeRadialDistortionCamPar(HTuple mode, HTuple camParamIn, HTuple distortionCoeffs, out HTuple camParamOut)

HCamPar HCamPar.ChangeRadialDistortionCamPar(string mode, HTuple distortionCoeffs)

HCamPar HCamPar.ChangeRadialDistortionCamPar(string mode, double distortionCoeffs)

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]]

Description

change_radial_distortion_cam_parchange_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamParchange_radial_distortion_cam_par modifies the internal camera parameters in accordance to the specified radial distortion coefficients DistortionCoeffsDistortionCoeffsDistortionCoeffsdistortionCoeffsdistortion_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 ModeModeModemodemode, one of the following modes can be selected:

'fixed'"fixed""fixed""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""fullsize""fullsize""fullsize":

For area scan cameras, the scale factors and and the image center point are modified in order to preserve the visible part of the scene. For line scan cameras with telecentric lenses, the scale factor , the image center point , and the 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""adaptive""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""fullsize""fullsize""fullsize" are modified.

'preserve_resolution'"preserve_resolution""preserve_resolution""preserve_resolution""preserve_resolution":

As in the mode 'fullsize'"fullsize""fullsize""fullsize""fullsize", all points visible in the original image are also visible in the modified (rectified) image. For area scan cameras, the scale factors and and the image center point are modified. For line scan cameras with telecentric lenses, the scale factor , the image center point , and potentially the 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""fullsize""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 CamParamOutCamParamOutCamParamOutcamParamOutcam_param_out are set to DistortionCoeffsDistortionCoeffsDistortionCoeffsdistortionCoeffsdistortion_coeffs. For telecentric line scan cameras, the motion vector also influences the percieved distortion. For example, a nonzero component leads to skewed pixels. Furthermore, if , the pixels appear to be non-square. Therefore, for telecentric line scan cameras, up to three more components can be passed in addition to or , respectively, in DistortionCoeffsDistortionCoeffsDistortionCoeffsdistortionCoeffsdistortion_coeffs. These specify the new , , and components of the motion vector.

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

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

ModeModeModemodemode (input_control)  string HTuplestrHTupleHtuple (string) (string) (HString) (char*)

Mode

Default: 'adaptive' "adaptive" "adaptive" "adaptive" "adaptive"

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

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

DistortionCoeffsDistortionCoeffsDistortionCoeffsdistortionCoeffsdistortion_coeffs (input_control)  real(-array) HTupleMaybeSequence[Union[float, int]]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Desired radial distortions.

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

Default: 0.0

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

Result

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

Possible Predecessors

camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationcamera_calibration, read_cam_parread_cam_parReadCamParReadCamParread_cam_par

Possible Successors

change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImagechange_radial_distortion_image, change_radial_distortion_contours_xldchange_radial_distortion_contours_xldChangeRadialDistortionContoursXldChangeRadialDistortionContoursXldchange_radial_distortion_contours_xld, gen_radial_distortion_mapgen_radial_distortion_mapGenRadialDistortionMapGenRadialDistortionMapgen_radial_distortion_map

See also

camera_calibrationcamera_calibrationCameraCalibrationCameraCalibrationcamera_calibration, read_cam_parread_cam_parReadCamParReadCamParread_cam_par, change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImagechange_radial_distortion_image, change_radial_distortion_contours_xldchange_radial_distortion_contours_xldChangeRadialDistortionContoursXldChangeRadialDistortionContoursXldchange_radial_distortion_contours_xld, change_radial_distortion_pointschange_radial_distortion_pointsChangeRadialDistortionPointsChangeRadialDistortionPointschange_radial_distortion_points

Module

Calibration