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

connect_grid_pointsT_connect_grid_pointsconnect_grid_pointsConnectGridPointsConnectGridPoints (Operator)

Name

connect_grid_pointsT_connect_grid_pointsconnect_grid_pointsConnectGridPointsConnectGridPoints — Establish connections between the grid points of the rectification grid.

Signature

connect_grid_points(Image : ConnectingLines : Row, Col, Sigma, MaxDist : )

Herror T_connect_grid_points(const Hobject Image, Hobject* ConnectingLines, const Htuple Row, const Htuple Col, const Htuple Sigma, const Htuple MaxDist)

Herror connect_grid_points(Hobject Image, Hobject* ConnectingLines, const HTuple& Row, const HTuple& Col, const HTuple& Sigma, const HTuple& MaxDist)

HXLDArray HImage::ConnectGridPoints(const HTuple& Row, const HTuple& Col, const HTuple& Sigma, const HTuple& MaxDist) const

void HOperatorSetX.ConnectGridPoints(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ConnectingLines, [in] VARIANT Row, [in] VARIANT Col, [in] VARIANT Sigma, [in] VARIANT MaxDist)

IHXLDX* HImageX.ConnectGridPoints(
[in] VARIANT Row, [in] VARIANT Col, [in] VARIANT Sigma, [in] VARIANT MaxDist)

static void HOperatorSet.ConnectGridPoints(HObject image, out HObject connectingLines, HTuple row, HTuple col, HTuple sigma, HTuple maxDist)

HXLD HImage.ConnectGridPoints(HTuple row, HTuple col, HTuple sigma, HTuple maxDist)

HXLD HImage.ConnectGridPoints(HTuple row, HTuple col, int sigma, double maxDist)

Description

connect_grid_pointsconnect_grid_pointsconnect_grid_pointsConnectGridPointsConnectGridPoints searches for connecting lines between the grid points (RowRowRowRowrow,ColColColColcol) of the rectification grid. The connecting lines are extracted from the input image ImageImageImageImageimage by a combination of an edge detector, a smoothing filter, and a line detector, each of size sigma. The sigma to be used is determined as follows: When a single value is passed in SigmaSigmaSigmaSigmasigma, this value is used. When a tuple of three values ('sigma_min'"sigma_min""sigma_min""sigma_min""sigma_min", 'sigma_max'"sigma_max""sigma_max""sigma_max""sigma_max", 'sigma_step'"sigma_step""sigma_step""sigma_step""sigma_step") is passed, connect_grid_pointsconnect_grid_pointsconnect_grid_pointsConnectGridPointsConnectGridPoints tests every sigma within a range from 'sigma_min'"sigma_min""sigma_min""sigma_min""sigma_min" to 'sigma_max'"sigma_max""sigma_max""sigma_max""sigma_max" with a step width of 'sigma_step'"sigma_step""sigma_step""sigma_step""sigma_step" and chooses the sigma that causes the greatest number of connecting lines. The same happens when a tuple of only two values 'sigma_min'"sigma_min""sigma_min""sigma_min""sigma_min" and 'sigma_max'"sigma_max""sigma_max""sigma_max""sigma_max" is passed. However, in this case a fixed step width of 0.05 is used.

Then, the extracted connecting lines are split at the grid points and those line segments are selected that start as well as end at a grid point. Note that edge detectors typically don't work very accurately in the proximity of edge junctions, and thus in general the connecting lines will not hit the grid points. Therefore, actually those connecting lines are split and selected that start at, end at, or pass a grid point at a maximum distance of MaxDistMaxDistMaxDistMaxDistmaxDist. The connecting lines are modified in order to start and end exactly in the corresponding grid points, and are returned in ConnectingLinesConnectingLinesConnectingLinesConnectingLinesconnectingLines as XLD contours.

Additionally, connect_grid_pointsconnect_grid_pointsconnect_grid_pointsConnectGridPointsConnectGridPoints calculates for each output XLD contour its type of transition and stores it in its global attribute 'bright_dark'"bright_dark""bright_dark""bright_dark""bright_dark". The attribute is set to 1.0, if the connecting line forms a bright-dark transition (left to right, viewed from start point to end point), otherwise it is set to 0.0.

Attention

For a reliable determination of the type of bright-dark transition as well as for the following rectification, it is necessary that each connecting line has at least three contour points. Therefore, connecting lines with only two contour points are not returned. Note, that the parameter MaxDistMaxDistMaxDistMaxDistmaxDist has a substantial influence on the length of the returned connecting lines, because all contour points of a possible connecting line that are closer than MaxDistMaxDistMaxDistMaxDistmaxDist to a grid point are replaced by one single contour point. If MaxDistMaxDistMaxDistMaxDistmaxDist is too big, some of the connecting lines might get lost.

Parallelization

Parameters

ImageImageImageImageimage (input_object)  singlechannelimage objectHImageHImageHImageXHobject (byte / uint2)

Input image.

ConnectingLinesConnectingLinesConnectingLinesConnectingLinesconnectingLines (output_object)  xld-array objectHXLDHXLDArrayHXLDXHobject *

Output contours.

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

Row coordinates of the grid points.

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

Column coordinates of the grid points.

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

SigmaSigmaSigmaSigmasigma (input_control)  number(-array) HTupleHTupleVARIANTHtuple (integer / real) (int / long / double) (Hlong / double) (Hlong / double) (Hlong / double)

Size of the applied Gaussians.

Number of elements: (1 <= Sigma) && (Sigma <= 3)

Default value: 0.9

Suggested values: 0.7, 0.9, 1.1, 1.3, 1.5

Restriction: 0.7 <= Sigma

MaxDistMaxDistMaxDistMaxDistmaxDist (input_control)  number HTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong)

Maximum distance of the connecting lines from the grid points.

Default value: 5.5

Suggested values: 1.5, 3.5, 5.5, 7.5, 9.5

Restriction: 0.0 <= MaxDist

Result

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

Possible Predecessors

saddle_points_sub_pixsaddle_points_sub_pixsaddle_points_sub_pixSaddlePointsSubPixSaddlePointsSubPix

Possible Successors

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