ClassesClassesClassesClasses | | | | Operators

gen_radial_distortion_mapT_gen_radial_distortion_mapGenRadialDistortionMapgen_radial_distortion_mapGenRadialDistortionMapGenRadialDistortionMap (Operator)

Name

gen_radial_distortion_mapT_gen_radial_distortion_mapGenRadialDistortionMapgen_radial_distortion_mapGenRadialDistortionMapGenRadialDistortionMap — Generate a projection map that describes the mapping of images corresponding to a changing radial distortion.

Signature

gen_radial_distortion_map( : Map : CamParamIn, CamParamOut, MapType : )

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

Herror gen_radial_distortion_map(Hobject* Map, const HTuple& CamParamIn, const HTuple& CamParamOut, const HTuple& MapType)

HImage HImage::GenRadialDistortionMap(const HTuple& CamParamIn, const HTuple& CamParamOut, const HTuple& MapType)

void GenRadialDistortionMap(HObject* Map, const HTuple& CamParamIn, const HTuple& CamParamOut, const HTuple& MapType)

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

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

void HOperatorSetX.GenRadialDistortionMap(
[out] IHUntypedObjectX*Map, [in] VARIANT CamParamIn, [in] VARIANT CamParamOut, [in] VARIANT MapType)

void HImageX.GenRadialDistortionMap(
[in] VARIANT CamParamIn, [in] VARIANT CamParamOut, [in] BSTR MapType)

static void HOperatorSet.GenRadialDistortionMap(out HObject map, HTuple camParamIn, HTuple camParamOut, HTuple mapType)

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

Description

gen_radial_distortion_mapgen_radial_distortion_mapGenRadialDistortionMapgen_radial_distortion_mapGenRadialDistortionMapGenRadialDistortionMap computes the mapping of images corresponding to a changing radial distortion in accordance to the internal camera parameters CamParamInCamParamInCamParamInCamParamInCamParamIncamParamIn and CamParamOutCamParamOutCamParamOutCamParamOutCamParamOutcamParamOut which can be obtained, e.g., using the operator calibrate_camerascalibrate_camerasCalibrateCamerascalibrate_camerasCalibrateCamerasCalibrateCameras. CamParamInCamParamInCamParamInCamParamInCamParamIncamParamIn and CamParamOutCamParamOutCamParamOutCamParamOutCamParamOutcamParamOut contain the old and the new camera parameters including the old and the new radial distortion, respectively (also see write_cam_parwrite_cam_parWriteCamParwrite_cam_parWriteCamParWriteCamPar 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 CamParamOutCamParamOutCamParamOutCamParamOutCamParamOutcamParamOut and subsequently projected into a subpixel position of the potential input image using CamParamInCamParamInCamParamInCamParamInCamParamIncamParamIn. Note that gen_radial_distortion_mapgen_radial_distortion_mapGenRadialDistortionMapgen_radial_distortion_mapGenRadialDistortionMapGenRadialDistortionMap can only be used with area-scan cameras.

The mapping function is stored in the output image MapMapMapMapMapmap. The size of MapMapMapMapMapmap is given by the camera parameters CamParamOutCamParamOutCamParamOutCamParamOutCamParamOutcamParamOut and therefore defines the size of the resulting mapped images using map_imagemap_imageMapImagemap_imageMapImageMapImage. The size of the images to be mapped with map_imagemap_imageMapImagemap_imageMapImageMapImage is determined by the camera parameters CamParamInCamParamInCamParamInCamParamInCamParamIncamParamIn. MapTypeMapTypeMapTypeMapTypeMapTypemapType is used to specify the type of the output MapMapMapMapMapmap. If 'nearest_neighbor'"nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor""nearest_neighbor" is chosen, MapMapMapMapMapmap 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""bilinear""bilinear""bilinear""bilinear" interpolation is chosen, MapMapMapMapMapmap 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 'coordinate_map_sub_pix'"coordinate_map_sub_pix""coordinate_map_sub_pix""coordinate_map_sub_pix""coordinate_map_sub_pix""coordinate_map_sub_pix" is chosen, MapMapMapMapMapmap 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 CamParamOutCamParamOutCamParamOutCamParamOutCamParamOutcamParamOut was computed via change_radial_distortion_cam_parchange_radial_distortion_cam_parChangeRadialDistortionCamParchange_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamPar, the mapping describes the effect of a lens with a modified radial distortion. If Kappa is 0 , the mapping corresponds to a rectification.

If several images have to be mapped using the same camera parameters, gen_radial_distortion_mapgen_radial_distortion_mapGenRadialDistortionMapgen_radial_distortion_mapGenRadialDistortionMapGenRadialDistortionMap in combination with map_imagemap_imageMapImagemap_imageMapImageMapImage is much more efficient than the operator change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImage 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_imagewrite_imageWriteImagewrite_imageWriteImageWriteImage, using the format 'tiff'"tiff""tiff""tiff""tiff""tiff".

Parallelization

Parameters

MapMapMapMapMapmap (output_object)  (multichannel-)image objectHImageHImageHImageHImageXHobject * (int4 / int8 / uint2 / vector_field)

Image containing the mapping data.

CamParamInCamParamInCamParamInCamParamInCamParamIncamParamIn (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Old camera parameters.

Number of elements: CamParamIn == 8 || CamParamIn == 12

CamParamOutCamParamOutCamParamOutCamParamOutCamParamOutcamParamOut (input_control)  number-array HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

New camera parameters.

Number of elements: CamParamOut == 8 || CamParamOut == 12

MapTypeMapTypeMapTypeMapTypeMapTypemapType (input_control)  string HTupleHTupleHTupleVARIANTHtuple (string) (string) (HString) (char*) (BSTR) (char*)

Type of the mapping.

Default value: 'bilinear' "bilinear" "bilinear" "bilinear" "bilinear" "bilinear"

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

Result

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

Possible Predecessors

change_radial_distortion_cam_parchange_radial_distortion_cam_parChangeRadialDistortionCamParchange_radial_distortion_cam_parChangeRadialDistortionCamParChangeRadialDistortionCamPar, camera_calibrationcamera_calibrationCameraCalibrationcamera_calibrationCameraCalibrationCameraCalibration, hand_eye_calibrationhand_eye_calibrationHandEyeCalibrationhand_eye_calibrationHandEyeCalibrationHandEyeCalibration

Possible Successors

map_imagemap_imageMapImagemap_imageMapImageMapImage

Alternatives

change_radial_distortion_imagechange_radial_distortion_imageChangeRadialDistortionImagechange_radial_distortion_imageChangeRadialDistortionImageChangeRadialDistortionImage

See also

change_radial_distortion_contours_xldchange_radial_distortion_contours_xldChangeRadialDistortionContoursXldchange_radial_distortion_contours_xldChangeRadialDistortionContoursXldChangeRadialDistortionContoursXld

Module

Calibration


ClassesClassesClassesClasses | | | | Operators