Skip to content

hysteresis_thresholdHysteresisThresholdHysteresisThresholdhysteresis_thresholdhysteresis_thresholdđź”—

Short descriptionđź”—

hysteresis_thresholdHysteresisThresholdHysteresisThresholdhysteresis_thresholdhysteresis_threshold — Perform a hysteresis threshold operation on an image.

Signatuređź”—

hysteresis_threshold( image Image, out region RegionHysteresis, number Low, number High, integer MaxLength )void HysteresisThreshold( const HObject& Image, HObject* RegionHysteresis, const HTuple& Low, const HTuple& High, const HTuple& MaxLength )static void HOperatorSet.HysteresisThreshold( HObject image, out HObject regionHysteresis, HTuple low, HTuple high, HTuple maxLength )def hysteresis_threshold( image: HObject, low: Union[int, float], high: Union[int, float], max_length: int ) -> HObject

Herror hysteresis_threshold( const Hobject Image, Hobject* RegionHysteresis, const Hlong Low, const Hlong High, const Hlong MaxLength )

Herror T_hysteresis_threshold( const Hobject Image, Hobject* RegionHysteresis, const Htuple Low, const Htuple High, const Htuple MaxLength )

HRegion HImage::HysteresisThreshold( const HTuple& Low, const HTuple& High, Hlong MaxLength ) const

HRegion HImage::HysteresisThreshold( Hlong Low, Hlong High, Hlong MaxLength ) const

HRegion HImage.HysteresisThreshold( HTuple low, HTuple high, int maxLength )

HRegion HImage.HysteresisThreshold( int low, int high, int maxLength )

Descriptionđź”—

hysteresis_thresholdHysteresisThreshold performs a hysteresis threshold operation (introduced by Canny) on an image. All points in the input image Imageimageimage having a gray value larger than or equal to Highhighhigh are immediately accepted (“secure” points). Conversely, all points with gray values less than Lowlowlow are immediately rejected. “Potential” points with gray values between both thresholds are accepted if they are connected to “secure” points by a path of “potential” points having a length of at most MaxLengthmaxLengthmax_length points. This means that “secure” points influence their surroundings (hysteresis).

Attentionđź”—

For images of type byte, uint2, or int4 the lower threshold must be Lowlowlow > 0.

Execution informationđź”—

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

  • Automatically parallelized on internal data level.

Parametersđź”—

Imageimageimage (input_object) singlechannelimage(-array) → object (byte / uint2 / int4 / real)HObject (byte / uint2 / int4 / real)HImage (byte / uint2 / int4 / real)HObject (byte / uint2 / int4 / real)Hobject (byte / uint2 / int4 / real)

Input image.

RegionHysteresisregionHysteresisregion_hysteresis (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Segmented region.

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

Lower threshold for the gray values.

Default: 3030
Suggested values: 5, 10, 15, 20, 30, 40, 50, 60, 70, 80, 90, 1005, 10, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100

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

Upper threshold for the gray values.

Default: 6060
Suggested values: 5, 10, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 1305, 10, 15, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120, 130
Restriction: High >= Low

MaxLengthmaxLengthmax_length (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Maximum length of a path of “potential” points to reach a “secure” point.

Default: 1010
Suggested values: 1, 2, 3, 5, 7, 10, 12, 14, 17, 20, 25, 30, 35, 40, 501, 2, 3, 5, 7, 10, 12, 14, 17, 20, 25, 30, 35, 40, 50
Value range: 1 ≤ MaxLength
Minimum increment: 1
Recommended increment: 5

Resultđź”—

hysteresis_thresholdHysteresisThreshold returns 2 (H_MSG_TRUE) if all parameters are correct. The behavior with respect to the input images and output regions can be determined by setting the values of the flags 'no_object_result'"no_object_result", 'empty_region_result'"empty_region_result", and 'store_empty_region'"store_empty_region" with set_systemSetSystem. If necessary, an exception is raised.

Combinations with other operatorsđź”—

Combinations

Alternatives

dyn_thresholdDynThreshold, thresholdThreshold, class_2dim_supClass2dimSup, fast_thresholdFastThreshold

See also

edges_imageEdgesImage, sobel_dirSobelDir, background_segBackgroundSeg

Referencesđź”—

J. Canny, “Finding Edges and Lines in Images”; Report, AI-TR-720, M.I.T. Artificial Intelligence Lab., Cambridge, MA, 1983.

Moduleđź”—

Foundation