Herror ::threshold_sub_pix (
    Hobject Image,
    Hobject *Border,
    const HTuple &Threshold
)
HXLDContArray HImage::ThresholdSubPix (
    const HTuple &Threshold
) const

Extract level crossings from an image with subpixel accuracy.

::threshold_sub_pix extracts the level crossings at the level Threshold of the input image Image with subpixel accuracy. The extracted level crossings are returned as XLD-contours in Border. In contrast to the operator ::threshold, ::threshold_sub_pix does not return regions, but the lines which separate regions with a gray value less than Threshold from regions with a gray value greater than Threshold.

For the extraction, the input image is regarded as a surface, in which the gray values are interpolated bilinearly between the centers of the individual pixels. Consistent with the surface thus defined, level crossing lines are extracted for each pixel and linked into topologically sound contours. This means that the level crossing contours are correctly split at junction points. If the image contains extended areas of constant gray value Threshold, only the border of such areas is returned as level crossings.


Parameters

Image (input_object)
singlechannelimage -> Hobject: HImage ( byte / int1 / int2 / int4 / real )
Input image.

Border (output_object)
xld_cont-array -> Hobject * : HXLDContArray
Extracted level crossings.

Threshold (input_control)
number -> HTuple.double / long
Threshold for the level crossings.
Default value: 128
Suggested values: 0.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.0


Example
/* Detection zero crossings of the Laplacian-of-Gaussian of aerial image */
HWindow Window(0,0,512,512);
HImage Image("fabrik");
HXLDContArray Border = Image.ThresholdSubPix(35);
Border.Display(Window);

Result

::threshold_sub_pix usually returns the value H_MSG_TRUE. If necessary, an exception is raised.


Alternatives

::threshold


See also

::zero_crossing_sub_pix


Module

Sub-pixel operators



Copyright © 1996-2002 MVTec Software GmbH