ClassesClasses | | Operators

gen_grid_rectification_mapT_gen_grid_rectification_mapGenGridRectificationMapGenGridRectificationMap (Operator)

Name

gen_grid_rectification_mapT_gen_grid_rectification_mapGenGridRectificationMapGenGridRectificationMap — Compute the mapping between the distorted image and the rectified image based upon the points of a regular grid.

Signature

gen_grid_rectification_map(Image, ConnectingLines : Map, Meshes : GridSpacing, Rotation, Row, Column, MapType : )

Herror T_gen_grid_rectification_map(const Hobject Image, const Hobject ConnectingLines, Hobject* Map, Hobject* Meshes, const Htuple GridSpacing, const Htuple Rotation, const Htuple Row, const Htuple Column, const Htuple MapType)

void GenGridRectificationMap(const HObject& Image, const HObject& ConnectingLines, HObject* Map, HObject* Meshes, const HTuple& GridSpacing, const HTuple& Rotation, const HTuple& Row, const HTuple& Column, const HTuple& MapType)

HImage HImage::GenGridRectificationMap(const HXLD& ConnectingLines, HXLD* Meshes, Hlong GridSpacing, const HTuple& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HImage::GenGridRectificationMap(const HXLD& ConnectingLines, HXLD* Meshes, Hlong GridSpacing, const HString& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HImage::GenGridRectificationMap(const HXLD& ConnectingLines, HXLD* Meshes, Hlong GridSpacing, const char* Rotation, const HTuple& Row, const HTuple& Column, const char* MapType) const

HImage HXLD::GenGridRectificationMap(const HImage& Image, HXLD* Meshes, Hlong GridSpacing, const HTuple& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLD::GenGridRectificationMap(const HImage& Image, HXLD* Meshes, Hlong GridSpacing, const HString& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLD::GenGridRectificationMap(const HImage& Image, HXLD* Meshes, Hlong GridSpacing, const char* Rotation, const HTuple& Row, const HTuple& Column, const char* MapType) const

HImage HXLDCont::GenGridRectificationMap(const HImage& Image, HXLDCont* Meshes, Hlong GridSpacing, const HTuple& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLDCont::GenGridRectificationMap(const HImage& Image, HXLDCont* Meshes, Hlong GridSpacing, const HString& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLDCont::GenGridRectificationMap(const HImage& Image, HXLDCont* Meshes, Hlong GridSpacing, const char* Rotation, const HTuple& Row, const HTuple& Column, const char* MapType) const

HImage HXLDPoly::GenGridRectificationMap(const HImage& Image, HXLDPoly* Meshes, Hlong GridSpacing, const HTuple& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLDPoly::GenGridRectificationMap(const HImage& Image, HXLDPoly* Meshes, Hlong GridSpacing, const HString& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLDPoly::GenGridRectificationMap(const HImage& Image, HXLDPoly* Meshes, Hlong GridSpacing, const char* Rotation, const HTuple& Row, const HTuple& Column, const char* MapType) const

HImage HXLDPara::GenGridRectificationMap(const HImage& Image, HXLDPara* Meshes, Hlong GridSpacing, const HTuple& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLDPara::GenGridRectificationMap(const HImage& Image, HXLDPara* Meshes, Hlong GridSpacing, const HString& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLDPara::GenGridRectificationMap(const HImage& Image, HXLDPara* Meshes, Hlong GridSpacing, const char* Rotation, const HTuple& Row, const HTuple& Column, const char* MapType) const

HImage HXLDModPara::GenGridRectificationMap(const HImage& Image, HXLDModPara* Meshes, Hlong GridSpacing, const HTuple& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLDModPara::GenGridRectificationMap(const HImage& Image, HXLDModPara* Meshes, Hlong GridSpacing, const HString& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLDModPara::GenGridRectificationMap(const HImage& Image, HXLDModPara* Meshes, Hlong GridSpacing, const char* Rotation, const HTuple& Row, const HTuple& Column, const char* MapType) const

HImage HXLDExtPara::GenGridRectificationMap(const HImage& Image, HXLDExtPara* Meshes, Hlong GridSpacing, const HTuple& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLDExtPara::GenGridRectificationMap(const HImage& Image, HXLDExtPara* Meshes, Hlong GridSpacing, const HString& Rotation, const HTuple& Row, const HTuple& Column, const HString& MapType) const

HImage HXLDExtPara::GenGridRectificationMap(const HImage& Image, HXLDExtPara* Meshes, Hlong GridSpacing, const char* Rotation, const HTuple& Row, const HTuple& Column, const char* MapType) const

static void HOperatorSet.GenGridRectificationMap(HObject image, HObject connectingLines, out HObject map, out HObject meshes, HTuple gridSpacing, HTuple rotation, HTuple row, HTuple column, HTuple mapType)

HImage HImage.GenGridRectificationMap(HXLD connectingLines, out HXLD meshes, int gridSpacing, HTuple rotation, HTuple row, HTuple column, string mapType)

HImage HImage.GenGridRectificationMap(HXLD connectingLines, out HXLD meshes, int gridSpacing, string rotation, HTuple row, HTuple column, string mapType)

HImage HXLD.GenGridRectificationMap(HImage image, out HXLD meshes, int gridSpacing, HTuple rotation, HTuple row, HTuple column, string mapType)

HImage HXLD.GenGridRectificationMap(HImage image, out HXLD meshes, int gridSpacing, string rotation, HTuple row, HTuple column, string mapType)

HImage HXLDCont.GenGridRectificationMap(HImage image, out HXLDCont meshes, int gridSpacing, HTuple rotation, HTuple row, HTuple column, string mapType)

HImage HXLDCont.GenGridRectificationMap(HImage image, out HXLDCont meshes, int gridSpacing, string rotation, HTuple row, HTuple column, string mapType)

HImage HXLDPoly.GenGridRectificationMap(HImage image, out HXLDPoly meshes, int gridSpacing, HTuple rotation, HTuple row, HTuple column, string mapType)

HImage HXLDPoly.GenGridRectificationMap(HImage image, out HXLDPoly meshes, int gridSpacing, string rotation, HTuple row, HTuple column, string mapType)

HImage HXLDPara.GenGridRectificationMap(HImage image, out HXLDPara meshes, int gridSpacing, HTuple rotation, HTuple row, HTuple column, string mapType)

HImage HXLDPara.GenGridRectificationMap(HImage image, out HXLDPara meshes, int gridSpacing, string rotation, HTuple row, HTuple column, string mapType)

HImage HXLDModPara.GenGridRectificationMap(HImage image, out HXLDModPara meshes, int gridSpacing, HTuple rotation, HTuple row, HTuple column, string mapType)

HImage HXLDModPara.GenGridRectificationMap(HImage image, out HXLDModPara meshes, int gridSpacing, string rotation, HTuple row, HTuple column, string mapType)

HImage HXLDExtPara.GenGridRectificationMap(HImage image, out HXLDExtPara meshes, int gridSpacing, HTuple rotation, HTuple row, HTuple column, string mapType)

HImage HXLDExtPara.GenGridRectificationMap(HImage image, out HXLDExtPara meshes, int gridSpacing, string rotation, HTuple row, HTuple column, string mapType)

Description

gen_grid_rectification_mapgen_grid_rectification_mapGenGridRectificationMapGenGridRectificationMapGenGridRectificationMap calculates the mapping between the grid points (RowRowRowRowrow,ColumnColumnColumnColumncolumn), which have been actually detected in the distorted image ImageImageImageImageimage (typically using saddle_points_sub_pixsaddle_points_sub_pixSaddlePointsSubPixSaddlePointsSubPixSaddlePointsSubPix), and the corresponding grid points of the ideal regular point grid. First, all paths that lead from their initial point via exactly four different connecting lines back to the initial point are assembled from the grid points (RowRowRowRowrow,ColumnColumnColumnColumncolumn) and the connecting lines ConnectingLinesConnectingLinesConnectingLinesConnectingLinesconnectingLines (detected by connect_grid_pointsconnect_grid_pointsConnectGridPointsConnectGridPointsConnectGridPoints). In case that the input of grid points (RowRowRowRowrow,ColumnColumnColumnColumncolumn) and of connecting lines ConnectingLinesConnectingLinesConnectingLinesConnectingLinesconnectingLines was meaningful, one such 'mesh' corresponds to exactly one grid cell in the rectification grid. Afterwards, the meshes are combined to the point grid. According to the value of RotationRotationRotationRotationrotation, the point grid is rotated by 0, 90, 180 or 270 degrees. Note that the point grid does not necessarily have the correct orientation. When passing 'auto'"auto""auto""auto""auto" in RotationRotationRotationRotationrotation, the point grid is rotated such that the black circular mark in the rectification grid is positioned to the left of the white one (see also create_rectification_gridcreate_rectification_gridCreateRectificationGridCreateRectificationGridCreateRectificationGrid). Finally, the mapping MapMapMapMapmap between the distorted image and the rectified image is calculated by interpolation between the grid points. Each grid cell, for which the coordinates (RowRowRowRowrow,ColumnColumnColumnColumncolumn) of all four corner points are known, is projected onto a square of GridSpacingGridSpacingGridSpacingGridSpacinggridSpacing x GridSpacingGridSpacingGridSpacingGridSpacinggridSpacing pixels.

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 'coord_map_sub_pix'"coord_map_sub_pix""coord_map_sub_pix""coord_map_sub_pix""coord_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.

gen_grid_rectification_mapgen_grid_rectification_mapGenGridRectificationMapGenGridRectificationMapGenGridRectificationMap additionally returns the calculated meshes as XLD contours in MeshesMeshesMeshesMeshesmeshes.

In contrary to gen_arbitrary_distortion_mapgen_arbitrary_distortion_mapGenArbitraryDistortionMapGenArbitraryDistortionMapGenArbitraryDistortionMap, gen_grid_rectification_mapgen_grid_rectification_mapGenGridRectificationMapGenGridRectificationMapGenGridRectificationMap and its predecessors are used when the coordinates (RowRowRowRowrow,ColumnColumnColumnColumncolumn) of the grid points in the distorted image are neither known nor can be derived from the image contents.

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

Attention

Each input XLD contour ConnectingLinesConnectingLinesConnectingLinesConnectingLinesconnectingLines must own the global attribute 'bright_dark'"bright_dark""bright_dark""bright_dark""bright_dark", as it is described with connect_grid_pointsconnect_grid_pointsConnectGridPointsConnectGridPointsConnectGridPoints!

Execution Information

Parameters

ImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHobject (byte / uint2)

Input image.

ConnectingLinesConnectingLinesConnectingLinesConnectingLinesconnectingLines (input_object)  xld-array objectHXLDHXLDHobject

Input contours.

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

Image containing the mapping data.

MeshesMeshesMeshesMeshesmeshes (output_object)  xld-array objectHXLDHXLDHobject *

Output contours.

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

Distance of the grid points in the rectified image.

Restriction: GridSpacing > 0

RotationRotationRotationRotationrotation (input_control)  string HTupleHTupleHtuple (string / integer) (string / int / long) (HString / Hlong) (char* / Hlong)

Rotation to be applied to the point grid.

Default value: 'auto' "auto" "auto" "auto" "auto"

List of values: 0, 90, 180, 270, 'auto'"auto""auto""auto""auto"

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

Row coordinates of the grid points.

ColumnColumnColumnColumncolumn (input_control)  point.x-array HTupleHTupleHtuple (real) (double) (double) (double)

Column coordinates of the grid points.

Restriction: number(Column) == number(Row)

MapTypeMapTypeMapTypeMapTypemapType (input_control)  string HTupleHTupleHtuple (string) (string) (HString) (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_grid_rectification_mapgen_grid_rectification_mapGenGridRectificationMapGenGridRectificationMapGenGridRectificationMap returns 2 (H_MSG_TRUE) if all parameter values are correct. If necessary, an exception is raised.

Possible Predecessors

connect_grid_pointsconnect_grid_pointsConnectGridPointsConnectGridPointsConnectGridPoints

Possible Successors

map_imagemap_imageMapImageMapImageMapImage

See also

gen_arbitrary_distortion_mapgen_arbitrary_distortion_mapGenArbitraryDistortionMapGenArbitraryDistortionMapGenArbitraryDistortionMap

Module

Calibration


ClassesClasses | | Operators