Back to Aurora Vision Library website

You are here: Start » Function Reference » Image » Image Spatial Transforms Maps » CreateUndistortionMap_Deprecated

CreateUndistortionMap_Deprecated


Header: AVL.h
Namespace: avl
Module: Calibration

Computes a spatial transform map for undistorting images from a calibrated camera.

Applications: Creation of a transform map that will be used with the RemapImage filter.

Syntax

void avl::CreateUndistortionMap_Deprecated
(
	const avl::Matrix& inCameraMatrix,
	const avl::LensDistortion& inDistortion,
	atl::Optional<int> inMapWidth,
	atl::Optional<int> inMapHeight,
	const avl::Vector2D& inMapShift,
	float inMapRotation,
	float inCameraRotationY,
	float inCameraRotationX,
	float inCameraRotationZ,
	const avl::ImageFormat& inImageFormat,
	avl::InterpolationMethod::Type inInterpolationMethod,
	avl::SpatialMap& outSpatialMap,
	atl::Optional<avl::Region&> outOutputRegion = atl::NIL
)

Parameters

Name Type Range Default Description
Input value inCameraMatrix const Matrix&
Input value inDistortion const LensDistortion&
Input value inMapWidth Optional<int> 1 - NIL Width of output map, default: same as example image.
Input value inMapHeight Optional<int> 1 - NIL Height of output map, default: same as example image.
Input value inMapShift const Vector2D& Translation from the principal point on the image plane.
Input value inMapRotation float Rotation of the principal point on the image plane.
Input value inCameraRotationY float Rotation of view around Y axis (a.k.a. Pan, Azimuth or Yaw)
Input value inCameraRotationX float Rotation of view around X axis (a.k.a. Tilt, Elevation or Pitch)
Input value inCameraRotationZ float Rotation of view around Z axis (a.k.a. Roll, Horizon)
Input value inImageFormat const ImageFormat& Information about dimensions, depth and pixel type of the image
Input value inInterpolationMethod InterpolationMethod::Type Bilinear
Output value outSpatialMap SpatialMap&
Output value outOutputRegion Optional<Region&> NIL

Optional Outputs

The computation of following outputs can be switched off by passing value atl::NIL to these parameters: outOutputRegion.

Read more about Optional Outputs.

Description

After determining the intrinsic camera matrix, and intrinsic distortion coefficients, this filter can be used to undo distortion of the images (undistortion).

The undistortion is performed through a general spatial transformation, using RemapImage. The result is a SpatialMap, i.e. a description of this transformation.

Examples

A calibration pattern: original - before undistortion.

A calibration pattern: remapped using RemapImage.
The SpatialMap used was generated with CreateUndistortionMap_Deprecated, for inInterpolationMethod = NearestNeighbour and Bilinear.

Remarks

The interpolation method chosen affects the speed of image remapping. Nearest neighbour is the fastest method, but bilinear interpolation provides higher quality.

The inImageFormat input describes dimensions and pixel format of the images that will be remapped with a RemapImage filter. Also an example image may be connected to this input and the format information will be extracted from it.

The outOutputRegion describes the region of valid pixels. If it does not cover the output area, it should be passed to RemapImage, to suppress the invalid pixels. To increase coverage, provide different values for inMapHeight and inMapWidth - to limit the output area to a valid region.

Errors

List of possible exceptions:

Error type Description
DomainError Camera matrix must be 3x3 in CreateUndistortionMap.
DomainError Empty camera matrix on input in CreateUndistortionMap.
DomainError Format of an empty image on input in CreateUndistortionMap.

See Also

  • RemapImage – Applies a precomputed image transform, defined by a spatial map object.