Skip to content

connect_grid_pointsConnectGridPointsConnectGridPointsconnect_grid_pointsT_connect_grid_pointsπŸ”—

Short descriptionπŸ”—

connect_grid_pointsConnectGridPointsConnectGridPointsconnect_grid_pointsT_connect_grid_points β€” Establish connections between the grid points of the rectification grid.

SignatureπŸ”—

connect_grid_points( image Image, out xld ConnectingLines, point.y Row, point.x Column, number Sigma, number MaxDist )void ConnectGridPoints( const HObject& Image, HObject* ConnectingLines, const HTuple& Row, const HTuple& Column, const HTuple& Sigma, const HTuple& MaxDist )static void HOperatorSet.ConnectGridPoints( HObject image, out HObject connectingLines, HTuple row, HTuple column, HTuple sigma, HTuple maxDist )def connect_grid_points( image: HObject, row: Sequence[float], column: Sequence[float], sigma: MaybeSequence[Union[float, int]], max_dist: Union[float, int] ) -> HObject

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

HXLD HImage::ConnectGridPoints( const HTuple& Row, const HTuple& Column, const HTuple& Sigma, const HTuple& MaxDist ) const

HXLD HImage::ConnectGridPoints( const HTuple& Row, const HTuple& Column, Hlong Sigma, double MaxDist ) const

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

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

DescriptionπŸ”—

connect_grid_pointsConnectGridPoints searches for connecting lines between the grid points (Rowrowrow,Columncolumncolumn) of the rectification grid. The connecting lines are extracted from the input image Imageimageimage 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 Sigmasigmasigma, this value is used. When a tuple of three values ('sigma_min'"sigma_min", 'sigma_max'"sigma_max", 'sigma_step'"sigma_step") is passed, connect_grid_pointsConnectGridPoints tests every \(\sigma\) within a range from 'sigma_min'"sigma_min" to 'sigma_max'"sigma_max" with a step width of '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" and 'sigma_max'"sigma_max" is passed. However, in this case a fixed step width of 0.050.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 MaxDistmaxDistmax_dist. The connecting lines are modified in order to start and end exactly in the corresponding grid points, and are returned in ConnectingLinesconnectingLinesconnecting_lines as XLD contours.

Additionally, connect_grid_pointsConnectGridPoints calculates for each output XLD contour its type of transition and stores it in its global attribute 'bright_dark'"bright_dark". The attribute is set to 1.01.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.00.0. For further information about global contour attributes see get_contour_global_attrib_xldGetContourGlobalAttribXld.

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 MaxDistmaxDistmax_dist 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 MaxDistmaxDistmax_dist to a grid point are replaced by one single contour point. If MaxDistmaxDistmax_dist is too big, some of the connecting lines might get lost.

Execution informationπŸ”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Processed without parallelization.

ParametersπŸ”—

Imageimageimage (input_object) singlechannelimage β†’ object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject (byte / uint2)

Input image.

ConnectingLinesconnectingLinesconnecting_lines (output_object) xld-array β†’ objectHObjectHXLDHObjectHobject *

Output contours.

Rowrowrow (input_control) point.y-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Row coordinates of the grid points.

Columncolumncolumn (input_control) point.x-array β†’ (real)HTuple (double)HTuple (double)Sequence[float]Htuple (double)

Column coordinates of the grid points.

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

Sigmasigmasigma (input_control) number(-array) β†’ (integer / real)HTuple (Hlong / double)HTuple (int / long / double)MaybeSequence[Union[float, int]]Htuple (Hlong / double)

Size of the applied Gaussians.

Number of elements: 1<=Sigma && Sigma<=3
Default: 0.90.9
Suggested values: 0.7, 0.9, 1.1, 1.3, 1.50.7, 0.9, 1.1, 1.3, 1.5
Restriction: 0.7 <= Sigma

MaxDistmaxDistmax_dist (input_control) number β†’ (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Maximum distance of the connecting lines from the grid points.

Default: 5.55.5
Suggested values: 1.5, 3.5, 5.5, 7.5, 9.51.5, 3.5, 5.5, 7.5, 9.5
Restriction: 0.0 <= MaxDist

ResultπŸ”—

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

Combinations with other operatorsπŸ”—

Combinations

Possible predecessors

saddle_points_sub_pixSaddlePointsSubPix

Possible successors

gen_grid_rectification_mapGenGridRectificationMap

ModuleπŸ”—

Calibration