Skip to content

threshold_sub_pixThresholdSubPixThresholdSubPixthreshold_sub_pixthreshold_sub_pix🔗

Short description🔗

threshold_sub_pixThresholdSubPixThresholdSubPixthreshold_sub_pixthreshold_sub_pix — Extract level crossings from an image with subpixel accuracy.

Signature🔗

threshold_sub_pix( image Image, out xld_cont Border, number Threshold )void ThresholdSubPix( const HObject& Image, HObject* Border, const HTuple& Threshold )static void HOperatorSet.ThresholdSubPix( HObject image, out HObject border, HTuple threshold )def threshold_sub_pix( image: HObject, threshold: Union[float, int] ) -> HObject

Herror threshold_sub_pix( const Hobject Image, Hobject* Border, double Threshold )

Herror T_threshold_sub_pix( const Hobject Image, Hobject* Border, const Htuple Threshold )

HXLDCont HImage::ThresholdSubPix( const HTuple& Threshold ) const

HXLDCont HImage::ThresholdSubPix( double Threshold ) const

HXLDCont HImage.ThresholdSubPix( HTuple threshold )

HXLDCont HImage.ThresholdSubPix( double threshold )

Description🔗

threshold_sub_pixThresholdSubPix extracts the level crossings at the level Thresholdthresholdthreshold of the input image Imageimageimage with subpixel accuracy. The extracted level crossings are returned as XLD-contours in Borderborderborder. In contrast to the operator thresholdThreshold, threshold_sub_pixThresholdSubPix does not return regions, but the lines that separate regions with a gray value less than Thresholdthresholdthreshold from regions with a gray value greater than Thresholdthresholdthreshold.

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 Thresholdthresholdthreshold, only the border of such areas is returned as level crossings.

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 / int1 / int2 / uint2 / int4 / real)HObject (byte / int1 / int2 / uint2 / int4 / real)HImage (byte / int1 / int2 / uint2 / int4 / real)HObject (byte / int1 / int2 / uint2 / int4 / real)Hobject (byte / int1 / int2 / uint2 / int4 / real)

Input image.

Borderborderborder (output_object) xld_cont-array → objectHObjectHXLDContHObjectHobject *

Extracted level crossings.

Thresholdthresholdthreshold (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[float, int]Htuple (double / Hlong)

Threshold for the level crossings.

Default: 128128
Suggested values: 0.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.00.0, 10.0, 30.0, 64.0, 128.0, 200.0, 220.0, 255.0

Example🔗

(HDevelop)

read_image(Image,'fabrik')
threshold_sub_pix(Image,Border,35)
dev_display(Border)
(C)
/* Detection zero crossings of the Laplacian-of-Gaussian of aerial image */
read_image(&Image,"fabrik")\;
threshold_sub_pix(Laplace,&Border,35)\;
disp_xld(Border,WindowHandle)\;
(C++)
/* 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_pixThresholdSubPix usually returns the value 2 (H_MSG_TRUE). If necessary, an exception is raised.

Combinations with other operators🔗

Combinations

Alternatives

thresholdThreshold

See also

zero_crossing_sub_pixZeroCrossingSubPix

Module🔗

2D Metrology