Skip to content

gray_tophatGrayTophatGrayTophatgray_tophatgray_tophat🔗

Short description🔗

gray_tophatGrayTophatGrayTophatgray_tophatgray_tophat — Perform a gray value top hat transformation on an image.

Signature🔗

gray_tophat( image Image, image SE, out image ImageTopHat )void GrayTophat( const HObject& Image, const HObject& SE, HObject* ImageTopHat )static void HOperatorSet.GrayTophat( HObject image, HObject SE, out HObject imageTopHat )def gray_tophat( image: HObject, se: HObject ) -> HObject

Herror gray_tophat( const Hobject Image, const Hobject SE, Hobject* ImageTopHat )

Herror T_gray_tophat( const Hobject Image, const Hobject SE, Hobject* ImageTopHat )

HImage HImage::GrayTophat( const HImage& SE ) const

HImage HImage.GrayTophat( HImage SE )

Description🔗

gray_tophatGrayTophat applies a gray value top hat transformation to the input image Imageimageimage with the structuring element SESEse. The image type of the structuring element SESEse must match the image type of the input image Imageimageimage. The gray value top hat transformation of an image \(i\) with a structuring element \(s\) is defined as

\[\begin{eqnarray*} \textit{tophat}(i,s) = i - (i \circ s) , \end{eqnarray*}\]

i.e., the difference of the image and its opening with \(s\) (see gray_openingGrayOpening). For the generation of structuring elements, see read_gray_seReadGraySe.

The top hat transformation is particularly fast for flat structuring elements, i.e. structuring elements with a constant gray level within their domain.

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 internal data level.

Parameters🔗

Imageimageimage (input_object) (multichannel-)image(-array) → object (byte / uint2 / real)HObject (byte / uint2 / real)HImage (byte / uint2 / real)HObject (byte / uint2 / real)Hobject (byte / uint2 / real)

Input image.

SESEse (input_object) singlechannelimage → object (byte / uint2 / real)HObject (byte / uint2 / real)HImage (byte / uint2 / real)HObject (byte / uint2 / real)Hobject (byte / uint2 / real)

Structuring element.

ImageTopHatimageTopHatimage_top_hat (output_object) (multichannel-)image(-array) → object (byte / uint2 / real)HObject (byte / uint2 / real)HImage (byte / uint2 / real)HObject (byte / uint2 / real)Hobject * (byte / uint2 / real)

Top hat image.

Result🔗

gray_tophatGrayTophat returns 2 (H_MSG_TRUE) if the structuring element is not the empty region. Otherwise, an exception is raised.

Combinations with other operators🔗

Combinations

Possible predecessors

read_gray_seReadGraySe, gen_disc_seGenDiscSe, read_imageReadImage

Possible successors

thresholdThreshold

Alternatives

gray_openingGrayOpening

See also

gray_bothatGrayBothat, top_hatTopHat, gray_erosion_rectGrayErosionRect, sub_imageSubImage

Module🔗

Foundation