Skip to content

change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImagechange_radial_distortion_imageT_change_radial_distortion_imageπŸ”—

Short descriptionπŸ”—

change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImagechange_radial_distortion_imageT_change_radial_distortion_image β€” Change the radial distortion of an image.

SignatureπŸ”—

change_radial_distortion_image( image Image, region Region, out image ImageRectified, campar CamParamIn, campar CamParamOut )change_radial_distortion_image( Image, Region : ImageRectified : CamParamIn, CamParamOut : )void ChangeRadialDistortionImage( const HObject& Image, const HObject& Region, HObject* ImageRectified, const HTuple& CamParamIn, const HTuple& CamParamOut )static void HOperatorSet.ChangeRadialDistortionImage( HObject image, HObject region, out HObject imageRectified, HTuple camParamIn, HTuple camParamOut )def change_radial_distortion_image( image: HObject, region: HObject, cam_param_in: Sequence[Union[int, float, str]], cam_param_out: Sequence[Union[int, float, str]] ) -> HObject

Herror T_change_radial_distortion_image( const Hobject Image, const Hobject Region, Hobject* ImageRectified, const Htuple CamParamIn, const Htuple CamParamOut )

HImage HImage::ChangeRadialDistortionImage( const HRegion& Region, const HCamPar& CamParamIn, const HCamPar& CamParamOut ) const

HImage HCamPar::ChangeRadialDistortionImage( const HImage& Image, const HRegion& Region, const HCamPar& CamParamOut ) const

HImage HImage.ChangeRadialDistortionImage( HRegion region, HCamPar camParamIn, HCamPar camParamOut )

HImage HCamPar.ChangeRadialDistortionImage( HImage image, HRegion region, HCamPar camParamOut )

DescriptionπŸ”—

change_radial_distortion_imageChangeRadialDistortionImage changes the radial distortion of the input image Imageimageimage in accordance to the internal camera parameters CamParamIncamParamIncam_param_in and CamParamOutcamParamOutcam_param_out. Each pixel of the output image that lies within the region Regionregionregion is transformed into the image plane using CamParamOutcamParamOutcam_param_out and subsequently projected into a subpixel of Imageimageimage using CamParamIncamParamIncam_param_in. The resulting gray value is determined by bilinear interpolation. If the subpixel is outside of Imageimageimage, the corresponding pixel in ImageRectifiedimageRectifiedimage_rectified is set to β€˜black’ and eliminated from the image domain.

If the gray values of all pixels in the output image shall be calculated, it is sufficient to pass an empty object in Regionregionregion (which must be previously generated by, for example, using gen_empty_objGenEmptyObj). This is especially useful if the size of the output image differs from the size of the input image, and hence, it is not possible to simply pass the region of the input image in Regionregionregion.

If CamParamOutcamParamOutcam_param_out was computed via change_radial_distortion_cam_parChangeRadialDistortionCamPar, ImageRectifiedimageRectifiedimage_rectified is equivalent to Imageimageimage obtained with a lens with a modified radial distortion \(\kappa\). If \(\kappa=0\) the image is rectified. A subsequent pose estimation (determination of the external camera parameters) is not affected by this operation.

Please note that change_radial_distortion_imageChangeRadialDistortionImage does not work for line scan cameras with perspective lenses. Instead, you might want to use image_to_world_planeImageToWorldPlane.

AttentionπŸ”—

change_radial_distortion_imageChangeRadialDistortionImage can be executed on OpenCL devices if the input image does not exceed the maximum size of image objects of the selected device. As the OpenCL implementation uses single precision arithmetic, the results can differ from the CPU implementation.

Execution informationπŸ”—

Execution information
  • Supports OpenCL compute devices.

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on channel level.

ParametersπŸ”—

Imageimageimage (input_object) (multichannel-)image(-array) β†’ object (byte / uint2 / real)object (byte / uint2 / real)HObject (byte / uint2 / real)HImage (byte / uint2 / real)HObject (byte / uint2 / real)Hobject (byte / uint2 / real)

Original image.

Regionregionregion (input_object) region β†’ objectobjectHObjectHRegionHObjectHobject

Region of interest in ImageRectifiedimageRectifiedimage_rectified.

ImageRectifiedimageRectifiedimage_rectified (output_object) (multichannel-)image(-array) β†’ object (byte / uint2 / real)object (byte / uint2 / real)HObject (byte / uint2 / real)HImage (byte / uint2 / real)HObject (byte / uint2 / real)Hobject * (byte / uint2 / real)

Resulting image with modified radial distortion.

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 parameter for Imageimageimage.

CamParamOutcamParamOutcam_param_out (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 parameter for Imageimageimage.

ResultπŸ”—

change_radial_distortion_imageChangeRadialDistortionImage returns 2 (H_MSG_TRUE) if all parameter values are correct. If the input is empty (no input image is available) the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

change_radial_distortion_cam_parChangeRadialDistortionCamPar, read_imageReadImage, grab_imageGrabImage

Possible successors

edges_imageEdgesImage, thresholdThreshold

See also

change_radial_distortion_cam_parChangeRadialDistortionCamPar, camera_calibrationCameraCalibration, read_cam_parReadCamPar, change_radial_distortion_contours_xldChangeRadialDistortionContoursXld, change_radial_distortion_pointsChangeRadialDistortionPoints

ModuleπŸ”—

Calibration