Skip to content

gen_radial_distortion_mapgen_radial_distortion_mapGenRadialDistortionMapGenRadialDistortionMapgen_radial_distortion_mapT_gen_radial_distortion_mapπŸ”—

Short descriptionπŸ”—

gen_radial_distortion_mapgen_radial_distortion_mapGenRadialDistortionMapGenRadialDistortionMapgen_radial_distortion_mapT_gen_radial_distortion_map β€” Generate a projection map that describes the mapping of images corresponding to a changing radial distortion.

SignatureπŸ”—

gen_radial_distortion_map( out image Map, campar CamParamIn, campar CamParamOut, string MapType )gen_radial_distortion_map( : Map : CamParamIn, CamParamOut, MapType : )void GenRadialDistortionMap( HObject* Map, const HTuple& CamParamIn, const HTuple& CamParamOut, const HTuple& MapType )static void HOperatorSet.GenRadialDistortionMap( out HObject map, HTuple camParamIn, HTuple camParamOut, HTuple mapType )def gen_radial_distortion_map( cam_param_in: Sequence[Union[int, float, str]], cam_param_out: Sequence[Union[int, float, str]], map_type: str ) -> HObject

Herror T_gen_radial_distortion_map( Hobject* Map, const Htuple CamParamIn, const Htuple CamParamOut, const Htuple MapType )

void HImage::GenRadialDistortionMap( const HCamPar& CamParamIn, const HCamPar& CamParamOut, const HString& MapType )

void HImage::GenRadialDistortionMap( const HCamPar& CamParamIn, const HCamPar& CamParamOut, const char* MapType )

void HImage::GenRadialDistortionMap( const HCamPar& CamParamIn, const HCamPar& CamParamOut, const wchar_t* MapType ) (Windows only)

HImage HCamPar::GenRadialDistortionMap( const HCamPar& CamParamOut, const HString& MapType ) const

HImage HCamPar::GenRadialDistortionMap( const HCamPar& CamParamOut, const char* MapType ) const

HImage HCamPar::GenRadialDistortionMap( const HCamPar& CamParamOut, const wchar_t* MapType ) const (Windows only)

void HImage.GenRadialDistortionMap( HCamPar camParamIn, HCamPar camParamOut, string mapType )

HImage HCamPar.GenRadialDistortionMap( HCamPar camParamOut, string mapType )

DescriptionπŸ”—

gen_radial_distortion_mapGenRadialDistortionMap computes the mapping of images corresponding to a changing radial distortion in accordance to the internal camera parameters CamParamIncamParamIncam_param_in and CamParamOutcamParamOutcam_param_out which can be obtained, e.g., using the operator calibrate_camerasCalibrateCameras. CamParamIncamParamIncam_param_in and CamParamOutcamParamOutcam_param_out contain the old and the new camera parameters including the old and the new radial distortion, respectively (also see Calibration for the sequence of the parameters and the underlying camera model). Each pixel of the potential output image is transformed into the image plane using CamParamOutcamParamOutcam_param_out and subsequently projected into a subpixel position of the potential input image using CamParamIncamParamIncam_param_in. Note that gen_radial_distortion_mapGenRadialDistortionMap can only be used with area scan cameras.

The mapping function is stored in the output image Mapmapmap. The size of Mapmapmap is given by the camera parameters CamParamOutcamParamOutcam_param_out and therefore defines the size of the resulting mapped images using map_imageMapImage. The size of the images to be mapped with map_imageMapImage is determined by the camera parameters CamParamIncamParamIncam_param_in. MapTypemapTypemap_type is used to specify the type of the output Mapmapmap. If 'nearest_neighbor'"nearest_neighbor" is chosen, Mapmapmap consists of one image containing one channel, in which for each pixel of the resulting image the linearized coordinate of the pixel of the input image is stored that is the nearest neighbor to the transformed coordinates. If 'bilinear'"bilinear" interpolation is chosen, Mapmapmap consists of one image containing five channels. In the first channel for each pixel in the resulting image the linearized coordinates of the pixel in the input image is stored that is in the upper left position relative to the transformed coordinates. The four other channels contain the weights of the four neighboring pixels of the transformed coordinates which are used for the bilinear interpolation, in the following order:

2 3
4 5

The second channel, for example, contains the weights of the pixels that lie to the upper left relative to the transformed coordinates. If 'coord_map_sub_pix'"coord_map_sub_pix" is chosen, Mapmapmap consists of one vector field image of the semantic type β€˜vector_field_absolute’, in which for each pixel of the resulting image the subpixel precise coordinates in the input image are stored.

If CamParamOutcamParamOutcam_param_out was computed via change_radial_distortion_cam_parChangeRadialDistortionCamPar, the mapping describes the effect of a lens with a modified radial distortion \(\kappa\). If \(\kappa=0\), the mapping corresponds to a rectification. A subsequent pose estimation (determination of the external camera parameters) is not affected by this operation.

If several images have to be mapped using the same camera parameters, gen_radial_distortion_mapGenRadialDistortionMap in combination with map_imageMapImage is much more efficient than the operator change_radial_distortion_imageChangeRadialDistortionImage because the transformation must be computed only once.

If you want to re-use the created map in another program, you can save it as a multi-channel image with the operator write_imageWriteImage, using the format 'tiff'"tiff".

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πŸ”—

Mapmapmap (output_object) (multichannel-)image β†’ object (int4 / int8 / uint2 / vector_field)object (int4 / int8 / uint2 / vector_field)HObject (int4 / int8 / uint2 / vector_field)HImage (int4 / int8 / uint2 / vector_field)HObject (int4 / int8 / uint2 / vector_field)Hobject * (int4 / int8 / uint2 / vector_field)

Image containing the mapping data.

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*)

Old camera parameters.

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*)

New camera parameters.

MapTypemapTypemap_type (input_control) string β†’ (string)(string)HTuple (HString)HTuple (string)strHtuple (char*)

Type of the mapping.

Default: 'bilinear'"bilinear"
List of values: 'bilinear', 'coord_map_sub_pix', 'nearest_neighbor'"bilinear", "coord_map_sub_pix", "nearest_neighbor"

ResultπŸ”—

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

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

change_radial_distortion_cam_parChangeRadialDistortionCamPar, camera_calibrationCameraCalibration, hand_eye_calibrationHandEyeCalibration

Possible successors

map_imageMapImage

Alternatives

change_radial_distortion_imageChangeRadialDistortionImage

See also

change_radial_distortion_contours_xldChangeRadialDistortionContoursXld

ModuleπŸ”—

Calibration