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

RectifyImage
Header: | FIL.h |
---|---|
Namespace: | fil |
Module: | Calibration |
Applies a spatial map to distorted image transforming it to rectified image defined in world coordinates.
Syntax
void fil::RectifyImage ( const fil::Image& inImage, const fil::RectificationMap& inRectificationMap, fil::Image& outImage, ftl::Optional< fil::Matrix& > outRectifiedTransform = ftl::NIL, ftl::Optional< fil::Point2D& > outWorldOrigin = ftl::NIL, ftl::Optional< float& > outWorldScale = ftl::NIL, ftl::Optional< float& > outWorldScaleInv = ftl::NIL )
Parameters
Name | Type | Default | Description | |
---|---|---|---|---|
![]() |
inImage | const Image& | Input image | |
![]() |
inRectificationMap | const RectificationMap& | The spatial map with associated data for world coordinates calculation on rectified image. Designed to be set with calibration GUI. | |
![]() |
outImage | Image& | Remapped image. | |
![]() |
outRectifiedTransform | Optional< Matrix& > | NIL | For convenient calculation of world coordinates on rectified image. Connects directly to Image...ToWorldPlane and WorldPlane...ToImage filters. The transformation is only translation + scaling. |
![]() |
outWorldOrigin | Optional< Point2D& > | NIL | Position of world origin on the rectified image. |
![]() |
outWorldScale | Optional< float& > | NIL | [pix / world unit] World scale of the rectified image. |
![]() |
outWorldScaleInv | Optional< float& > | NIL | [world unit / pix] Inverse of outWorldScale. Connects directly to inResolution input of filters such as PointToPointDistance. |
Optional Outputs
The computation of following outputs can be switched off by passing value ftl::NIL
to these parameters: outRectifiedTransform, outWorldOrigin, outWorldScale, outWorldScaleInv.
Read more about Optional Outputs.
Description
Uses a RectificationMap computed by CreateRectificationMap* filters (such as CreateRectificationMap_PixelUnits or CreateRectificationMap_WorldUnits) for image rectification onto a defined world plane. Point locations on rectified images are related to the world plane only by translation and scaling.
Auxiliary outputs outWorldOrigin and outWorldScale fully describe the relation of rectified image to world plane. For convenience the outRectifiedTransform output is provided, which describes the same relation, however it can be directly connected to the ImagePointsToWorldPlane filter family to obtain world coordinates of points detected on the remapped (rectified) image.
Examples
![]() |
![]() |
|||
Left: original image, as captured by a camera, with mild lens distortion present. Right: rectified image with annotated length measurement. |
See Also
- RemapImage – Applies a precomputed image transform, defined by a spatial map object.