HALCON Reference Manual 10.0.2
Table of Contents / Tools / Grid Rectification ClassesClassesClasses | | | Operators

gen_arbitrary_distortion_mapT_gen_arbitrary_distortion_mapgen_arbitrary_distortion_mapGenArbitraryDistortionMapGenArbitraryDistortionMap (Operator)

Name

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

Signature

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

Herror T_gen_arbitrary_distortion_map(Hobject* Map, const Htuple GridSpacing, const Htuple Row, const Htuple Col, const Htuple GridWidth, const Htuple ImageWidth, const Htuple ImageHeight, const Htuple MapType)

Herror gen_arbitrary_distortion_map(Hobject* Map, const HTuple& GridSpacing, const HTuple& Row, const HTuple& Col, const HTuple& GridWidth, const HTuple& ImageWidth, const HTuple& ImageHeight, const HTuple& MapType)

void HOperatorSetX.GenArbitraryDistortionMap(
[out] IHUntypedObjectX*Map, [in] VARIANT GridSpacing, [in] VARIANT Row, [in] VARIANT Col, [in] VARIANT GridWidth, [in] VARIANT ImageWidth, [in] VARIANT ImageHeight, [in] VARIANT MapType)

IHImageX* HMiscX.GenArbitraryDistortionMap(
[in] Hlong GridSpacing, [in] VARIANT Row, [in] VARIANT Col, [in] Hlong GridWidth, [in] Hlong ImageWidth, [in] Hlong ImageHeight, [in] BSTR MapType)

static void HOperatorSet.GenArbitraryDistortionMap(out HObject map, HTuple gridSpacing, HTuple row, HTuple col, HTuple gridWidth, HTuple imageWidth, HTuple imageHeight, HTuple mapType)

static HImage HMisc.GenArbitraryDistortionMap(int gridSpacing, HTuple row, HTuple col, int gridWidth, int imageWidth, int imageHeight, string mapType)

Description

gen_arbitrary_distortion_mapgen_arbitrary_distortion_mapgen_arbitrary_distortion_mapGenArbitraryDistortionMapGenArbitraryDistortionMap computes the mapping MapMapMapMapmap between an arbitrarily distorted image and the rectified image. Assuming that the points (RowRowRowRowrow,ColColColColcol) form a regular grid in the rectified image, each grid cell, which is defined by the coordinates (RowRowRowRowrow,ColColColColcol) of its four corners in the distorted image, is projected onto a square of GridSpacingGridSpacingGridSpacingGridSpacinggridSpacing x GridSpacingGridSpacingGridSpacingGridSpacinggridSpacing pixels. The coordinates of the grid points must be passed line by line in RowRowRowRowrow and ColColColColcol. GridWidthGridWidthGridWidthGridWidthgridWidth is the width of the point grid in grid points. To compute the mapping MapMapMapMapmap, additionally the width ImageWidthImageWidthImageWidthImageWidthimageWidth and height ImageHeightImageHeightImageHeightImageHeightimageHeight of the images to be rectified must be passed.

MapTypeMapTypeMapTypeMapTypemapType is used to specify the type of the output MapMapMapMapmap. If 'bilinear'"bilinear""bilinear""bilinear""bilinear" interpolation is chosen, MapMapMapMapmap 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" is chosen, MapMapMapMapmap consists of one vector field image, in which for each pixel of the resulting image the subpixel precise coordinates in the input image are stored.

In contrary to gen_grid_rectification_mapgen_grid_rectification_mapgen_grid_rectification_mapGenGridRectificationMapGenGridRectificationMap, gen_arbitrary_distortion_mapgen_arbitrary_distortion_mapgen_arbitrary_distortion_mapGenArbitraryDistortionMapGenArbitraryDistortionMap is used when the coordinates (RowRowRowRowrow,ColColColColcol) 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.

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_imagewrite_imageWriteImageWriteImage, using the format 'tiff'"tiff""tiff""tiff""tiff".

Parallelization

Parameters

MapMapMapMapmap (output_object)  multichannel-image objectHImageHImageHImageXHobject * (int4 / uint2 / vector_field)

Image containing the mapping data.

GridSpacingGridSpacingGridSpacingGridSpacinggridSpacing (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Distance of the grid points in the rectified image.

Restriction: GridSpacing > 0

RowRowRowRowrow (input_control)  point.y-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Row coordinates of the grid points in the distorted image.

ColColColColcol (input_control)  point.x-array HTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double)

Column coordinates of the grid points in the distorted image.

Restriction: number(Row) == number(Col)

GridWidthGridWidthGridWidthGridWidthgridWidth (input_control)  integer HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Width of the point grid (number of grid points).

ImageWidthImageWidthImageWidthImageWidthimageWidth (input_control)  extent.x HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Width of the images to be rectified.

Restriction: ImageWidth > 0

ImageHeightImageHeightImageHeightImageHeightimageHeight (input_control)  extent.y HTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong)

Height of the images to be rectified.

Restriction: ImageHeight > 0

MapTypeMapTypeMapTypeMapTypemapType (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Type of mapping.

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

List of values: '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"

Result

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

Possible Successors

map_imagemap_imagemap_imageMapImageMapImage

See also

create_rectification_gridcreate_rectification_gridcreate_rectification_gridCreateRectificationGridCreateRectificationGrid, find_rectification_gridfind_rectification_gridfind_rectification_gridFindRectificationGridFindRectificationGrid, connect_grid_pointsconnect_grid_pointsconnect_grid_pointsConnectGridPointsConnectGridPoints, gen_grid_rectification_mapgen_grid_rectification_mapgen_grid_rectification_mapGenGridRectificationMapGenGridRectificationMap

Module

Calibration


Table of Contents / Tools / Grid Rectification ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH