Herror ::line_position (
    const HTuple &RowBegin,
    const HTuple &ColBegin,
    const HTuple &RowEnd,
    const HTuple &ColEnd,
    double *RowCenter,
    double *ColCenter,
    double *Length,
    double *Phi
)
Herror ::line_position (
    const HTuple &RowBegin,
    const HTuple &ColBegin,
    const HTuple &RowEnd,
    const HTuple &ColEnd,
    HTuple *RowCenter,
    HTuple *ColCenter,
    HTuple *Length,
    HTuple *Phi
)

Calculate the center of gravity, length, and orientation of a line.

The operator ::line_position returns the center (RowCenter, ColCenter), the (Euclidean) length (Length) and the orientation (-2 < Phi 2) of the given lines. If more than one line is to be treated the line and column indices can be passed as tuples. In this case the output parameters, of course, are also tuples.

The routine is applied, for example, to model lines in order to determine search regions for the edge detection (::detect_edge_segments).


Parameters

RowBegin (input_control)
line.begin.y(-array) -> HTuple.long
Row coordinates of the starting points of the input lines.

ColBegin (input_control)
line.begin.x(-array) -> HTuple.long
Column coordinates of the starting points of the input lines.

RowEnd (input_control)
line.end.y(-array) -> HTuple.long
Row coordinates of the ending points of the input lines.

ColEnd (input_control)
line.end.x(-array) -> HTuple.long
Column coordinates of the ending points of the input lines.

RowCenter (output_control)
point.y(-array) -> (HTuple.) double *
Row coordinates of the centers of gravity of the input lines.

ColCenter (output_control)
point.x(-array) -> (HTuple.) double *
Column coordinates of the centers of gravity of the input lines.

Length (output_control)
real(-array) -> (HTuple.) double *
Euclidean length of the input lines.

Phi (output_control)
angle.rad(-array) -> (HTuple.) double *
Orientation of the input lines.


Result

::line_position always returns the value H_MSG_TRUE.


Possible Predecessors

::sobel_amp, ::edges_image, ::threshold, ::hysteresis_threshold, ::split_skeleton_region, ::split_skeleton_lines


Possible Successors

::set_line_width, ::disp_line


Alternatives

::line_orientation, ::select_lines, ::partition_lines


See also

::line_orientation, ::select_lines, ::partition_lines, ::detect_edge_segments


Module

Region processing



Copyright © 1996-2002 MVTec Software GmbH