edges_color_sub_pix — Extract subpixel precise color edges using Deriche, Shen, or Canny filters.
edges_color_sub_pix extracts subpixel precise color edges from the input image Image. The definition of color edges is given in the description of edges_color. The same edge filters as in edges_color can be selected: 'canny', 'deriche1', 'deriche2', and 'shen'. In addition, a fast Sobel filter can be selected with 'sobel_fast'. The filters are specified by the parameter Filter.
The “filter width” (i.e., the amount of smoothing) can be chosen arbitrarily. For a detailed description of this parameter see edges_color. This parameter is ignored for Filter = 'sobel_fast'.
The extracted edges are returned as subpixel precise XLD contours in Edges. For all edge operators except for 'sobel_fast', the following attributes are defined for each edge point (see get_contour_attrib_xld):
'edge_direction': Edge direction 'angle': Direction of the normal vectors to the contour (oriented such that the normal vectors point to the right side of the contour as the contour is traversed from start to end point; the angles are given with respect to the row axis of the image.) 'response': Edge amplitude (color gradient magnitude)
edges_color_sub_pix links the edge points into edges by using an algorithm similar to a hysteresis threshold operation, which is also used in edges_sub_pix and lines_gauss. Points with an amplitude larger than High are immediately accepted as belonging to an edge, while points with an amplitude smaller than Low are rejected. All other points are accepted as edges if they are connected to accepted edge points (see also lines_gauss and hysteresis_threshold).
Because edge extractors are often unable to extract certain junctions, a mode that tries to extract these missing junctions by different means can be selected by appending '_junctions' to the values of Filter that are described above. This mode is analogous to the mode for completing junctions that is available in edges_sub_pix and lines_gauss.
The edge operator 'sobel_fast' has the same semantics as all the other edge operators. Internally, howver, it is based on significantly simplified variants of the individual processing steps (hysteresis thresholding, edge point linking, and extraction of the subpixel edge positions). Therefore, 'sobel_fast' in some cases may return slightly less accurate edge positions and may select different edge parts.
Edge operator to be applied.
Default value: 'canny'
List of values: 'canny', 'canny_junctions', 'deriche1', 'deriche1_junctions', 'deriche2', 'deriche2_junctions', 'shen', 'shen_junctions', 'sobel_fast'
Filter parameter: small values result in strong smoothing, and thus less detail (opposite for 'canny').
Default value: 1.0
Suggested values: 0.1, 0.2, 0.3, 0.4, 0.5, 0.7, 0.9, 1.0, 1.1, 1.2, 1.5, 2.0, 2.5, 3.0
Typical range of values: 0.7 ≤ Alpha ≤ 50.0
Minimum increment: 0.01
Recommended increment: 0.1
Restriction: Alpha > 0.0
Lower threshold for the hysteresis threshold operation.
Default value: 20
Suggested values: 5, 10, 15, 20, 25, 30, 40
Typical range of values: 1 ≤ Low
Minimum increment: 1
Recommended increment: 5
Restriction: Low > 0
Upper threshold for the hysteresis threshold operation.
Default value: 40
Suggested values: 10, 15, 20, 25, 30, 40, 50, 60, 70
Typical range of values: 1 ≤ High
Minimum increment: 1
Recommended increment: 5
Restriction: High > 0 && High >= Low
The amount of temporary memory required is dependent on the height H of the domain of Image.
edges_color_sub_pix returns 2 (H_MSG_TRUE) if all parameters are correct and no error occurs during execution. If the input is empty the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.
edges_image, edges_sub_pix, info_edges, hysteresis_threshold, lines_gauss, lines_facet
C. Steger: “Subpixel-Precise Extraction of Lines and Edges”;
International Archives of Photogrammetry and Remote Sensing,
vol. XXXIII, part B3; pp. 141-156; 2000.
C. Steger: “Unbiased Extraction of Curvilinear Structures from 2D and 3D Images”; Herbert Utz Verlag, München; 1998.
S. Di Zenzo: “A Note on the Gradient of a Multi-Image”; Computer Vision, Graphics, and Image Processing, vol. 33; pp. 116-125; 1986.
Aldo Cumani: “Edge Detection in Multispectral Images”; Computer Vision, Graphics, and Image Processing: Graphical Models and Image Processing, vol. 53, no. 1; pp. 40-51; 1991.
J.Canny: “Finding Edges and Lines in Images”; Report, AI-TR-720; M.I.T. Artificial Intelligence Lab., Cambridge; 1983.
J.Canny: “A Computational Approach to Edge Detection”; IEEE Transactions on Pattern Analysis and Machine Intelligence; PAMI-8, vol. 6; pp. 679-698; 1986.
R.Deriche: “Using Canny's Criteria to Derive a Recursively Implemented Optimal Edge Detector”; International Journal of Computer Vision; vol. 1, no. 2; pp. 167-187; 1987.
R.Deriche: “Fast Algorithms for Low-Level Vision”; IEEE Transactions on Pattern Analysis and Machine Intelligence; PAMI-12, no. 1; pp. 78-87; 1990.
J. Shen, S. Castan: “An Optimal Linear Operator for Step Edge Detection”; Computer Vision, Graphics, and Image Processing: Graphical Models and Image Processing, vol. 54, no. 2; pp. 112-133; 1992.