Compute the parallel contour of an XLD contour.
::gen_parallel_contour_xld computes for each of the input contours Contours a parallel contour with distance Distance. The resulting contours are returned in ParallelContours. To calculate the parallel contour, the normal vector of the input contour is needed in every contour point. The parameter Mode detemines how these normal vectors are computed. If Mode = 'gradient', it is assumed that the input contours are edges, and the normal information is obtained from the gradient direction of the edge (see ::edges_sub_pix). For this, the attribute 'edge_direction' must exist for the input contour. If Mode = 'contour_normal', a possibly existing normal information is used to determine the normals. For this, the contour attribute 'angle' must exist (see ::lines_gauss, ::lines_facet, or ::edges_sub_pix). Finally, if Mode = 'regression_normal', the normal vectors are determined from a local line fit to each contour point. Here, the normal vectors are oriented such that they point to the right side of the contour when the contour is traversed from start to end. In contrast to the first two modes, this mode can be used for all XLD contours, no matter how they were generated.
|
Contours (input_object) |
xld_cont-array -> Hobject: HXLDContArray |
| Contours to be transformed. | |
|
ParallelContours (output_object) |
xld_cont-array -> Hobject * : HXLDContArray |
| Parallel contours. | |
|
Mode (input_control) |
string -> HTuple.char * |
| Mode, with which the direction information is computed. | |
| Default value: 'regression_normal' | |
| Suggested values: 'gradient', 'contour_normal', 'regression_normal' | |
|
Distance (input_control) |
number -> HTuple.double / long |
| Distance of the parallel contour. | |
| Default value: 1 | |
| List of values: 0.2, 0.4, 0.6, 0.8, 1, 2, 3, 4, 5, 7, 10, 15, 20, 30, 40, 50 | |
::gen_contours_skeleton_xld, ::lines_gauss, ::lines_facet, ::edges_sub_pix
Sub-pixel operators