You are here: Start » Function Reference » Computer Vision » Camera Calibration » CreateRectificationMap_WorldUnits

CreateRectificationMap_WorldUnits
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | Calibration |
Computes a spatial map for transforming distorted images to rectified images defined in world coordinate plane. Defines the output geometry in world units.
Applications: Specification of output geometry in world units is especially useful in image stitching.
Syntax
void fil::CreateRectificationMap_WorldUnits ( const fil::ImageFormat& inImageFormat, float inLeftBound, float inRightBound, float inTopBound, float inBottomBound, const ftl::Optional<float>& inWorldScale, bool inInvertedWorldY, fil::InterpolationMethod::Type inInterpolationMethod, const fil::RectificationTransform& inTransform, fil::RectificationMap& outRectificationMap )
Parameters
Name | Type | Range | Default | Description | |
---|---|---|---|---|---|
![]() |
inImageFormat | const ImageFormat& | Input image format. | ||
![]() |
inLeftBound | float | World X coordinate of left side of generated output image. | ||
![]() |
inRightBound | float | World X coordinate of right side of generated output image. | ||
![]() |
inTopBound | float | World Y coordinate of top side of generated output image. | ||
![]() |
inBottomBound | float | World Y coordinate of bottom side of generated output image. | ||
![]() |
inWorldScale | const Optional<float>& | 0.001 - ![]() |
NIL | [pix / world unit] Specifies the scale for output image. By default scale is calculated such that there will be no rescaling at the center of output image. |
![]() |
inInvertedWorldY | bool | False | Set to true if world coordinate system has right-handed orientation, also known as mathematical or standard. This effectively mirrors the rectified image vertically. | |
![]() |
inInterpolationMethod | InterpolationMethod::Type | Bilinear | ||
![]() |
inTransform | const RectificationTransform& | Transform's camera model is needed for undistortion of image, when not supplied the generated map will assume undistorted image on input. Transform's homography is needed for transforming to given world plane, when not supplied the generated map will only remove distortion of image. | ||
![]() |
outRectificationMap | RectificationMap& |
Description
Creates a RectificationMap, which is used by RectifyImage filter for image rectification onto a defined world plane. Point locations on rectified images are related to the world plane (defined by inTransform) only by translation and scaling.
The inTransform may not contain a camera model – in such case the the generated map will assume undistorted image on input.
The output image dimensions, resolution and cropping are specified by:
- inLeftBound,inRightBound,inTopBound,inBottomBound - real world coordinate boundaries of the area which output image will cover.
- inWorldScale - the scale for output image, defined in pixels per world unit.
For example, if one is interested in area spanning from (0,0) to (10,6) world coordinate, with resolution 100 pixels / world unit, then inputs would be set as follows:
- inLeftBound = 0
- inRightBound = 10
- inTopBound = 0
- inBottomBound = 6
- inWorldScale = 100
Auxiliary data contained inside the RectificationMap describes the relation of rectified image to the world plane.
Examples
![]() |
![]() |
|||
Left: original image, as captured by a camera, with mild lens distortion present. Right: rectified image with annotated length measurement. |
Errors
List of possible exceptions:
Error type | Description |
---|---|
DomainError | inLeftBound should be less than inRightBound |
DomainError | inTopBound should be less than inBottomBound |