gen_arbitrary_distortion_map ( : Map : GridSpacing, Row, Col, GridWidth, ImageWidth, ImageHeight : )

Generate a projection map that describes the mapping between an arbitrarily distorted image and the rectified image.

gen_arbitrary_distortion_map computes the mapping Map between an arbitrarily distorted image and the rectified image. Assuming that the points (Row,Col) form a regular grid in the rectified image, each grid cell, which is defined by the coordinates (Row,Col) of its four corners in the distorted image, is projected onto a square of GridSpacing x GridSpacing pixels. The coordinates of the grid points must be passed line by line in Row and Col. GridWidth is the width of the point grid in grid points. To compute the mapping Map, additionally the width ImageWidth and height ImageHeight of the images to be rectified must be passed.

Map 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 that is in the upper left position relative to the transformed coordinates are stored. 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.

In contrary to gen_grid_rectification_map, gen_arbitrary_distortion_map is used when the coordinates (Row,Col) of the grid points in the distorted image are already known or the relevant part of the image consist of regular grid structures, which the coordinates can be derived from.


Parameters

Map (output_object)
multichannel-image -> object : int4 / uint2
Image containing the mapping data.

GridSpacing (input_control)
integer -> integer
Distance of the grid points in the rectified image.
Restriction: GridSpacing > 0

Row (input_control)
point.y-array -> real
Row coordinates of the grid points in the distorted image.

Col (input_control)
point.x-array -> real
Column coordinates of the grid points in the distorted image.
Restriction: number(Row) == number(Col)

GridWidth (input_control)
integer -> integer
Width of the point grid (number of grid points).

ImageWidth (input_control)
extent.x -> integer
Width of the images to be rectified.
Restriction: ImageWidth > 0

ImageHeight (input_control)
extent.y -> integer
Height of the images to be rectified.
Restriction: ImageHeight > 0


Result

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


Parallelization Information

gen_arbitrary_distortion_map is processed completely exclusively without parallelization.


Possible Successors

map_image


See also

create_rectification_grid, find_rectification_grid, connect_grid_points, gen_grid_rectification_map


Module

Calibration



Copyright © 1996-2008 MVTec Software GmbH