Skip to content

highpass_imageHighpassImageHighpassImagehighpass_imagehighpass_image๐Ÿ”—

Short description๐Ÿ”—

highpass_imageHighpassImageHighpassImagehighpass_imagehighpass_image โ€” Extract high frequency components from an image.

Signature๐Ÿ”—

highpass_image( image Image, out image Highpass, extent.x Width, extent.y Height )void HighpassImage( const HObject& Image, HObject* Highpass, const HTuple& Width, const HTuple& Height )static void HOperatorSet.HighpassImage( HObject image, out HObject highpass, HTuple width, HTuple height )def highpass_image( image: HObject, width: int, height: int ) -> HObject

Herror highpass_image( const Hobject Image, Hobject* Highpass, const Hlong Width, const Hlong Height )

Herror T_highpass_image( const Hobject Image, Hobject* Highpass, const Htuple Width, const Htuple Height )

HImage HImage::HighpassImage( Hlong Width, Hlong Height ) const

HImage HImage.HighpassImage( int width, int height )

Description๐Ÿ”—

highpass_imageHighpassImage extracts high frequency components in an image by applying a linear filter with the following matrix (in case of a 7x5 matrix):

       1       1       1       1       1       1       1
       1       1       1       1       1       1       1
       1       1       1      -35      1       1       1
       1       1       1       1       1       1       1
       1       1       1       1       1       1       1

This corresponds to applying a mean operator (mean_imageMeanImage), and then subtracting the original gray value. For byte images, a value of 128 is added to the result, i.e., zero crossings occur for 128. Correspondingly for uint2 images, 32767 is added.

This filter emphasizes high frequency components (edges and corners). The cutoff frequency is determined by the size (Height x Width) of the filter matrix: the larger the matrix, the smaller the cutoff frequency is.

At the image borders the pixelsโ€™ gray values are mirrored. In case of over- or underflow the gray values are clipped (255 and 0, resp.).

Attention๐Ÿ”—

If even values are passed for Heightheightheight or Widthwidthwidth, the operator uses the next larger odd value instead. Thus, the center of the filter mask is always uniquely determined.

highpass_imageHighpassImage can be executed on OpenCL devices. The same limitations as for mean_imageMeanImage and sub_imageSubImage apply.

Note that filter operators may return unexpected results if an image with a reduced domain is used as input. Please refer to the chapter Filters.

Execution information๐Ÿ”—

Execution information
  • Supports OpenCL compute devices.

  • 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 channel level.

  • Automatically parallelized on domain level.

Parameters๐Ÿ”—

Imageimageimage (input_object) (multichannel-)image(-array) โ†’ object (byte* / uint2*)HObject (byte* / uint2*)HImage (byte* / uint2*)HObject (byte* / uint2*)Hobject (byte* / uint2*) *allowed for compute devices

Input image.

Highpasshighpasshighpass (output_object) (multichannel-)image(-array) โ†’ object (byte / uint2)HObject (byte / uint2)HImage (byte / uint2)HObject (byte / uint2)Hobject * (byte / uint2)

High-pass-filtered result image.

Widthwidthwidth (input_control) extent.x โ†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of the filter mask.

Default: 99
Suggested values: 3, 5, 7, 9, 11, 13, 17, 21, 29, 41, 51, 73, 1013, 5, 7, 9, 11, 13, 17, 21, 29, 41, 51, 73, 101
Value range: 1 โ‰ค Width
Minimum increment: 2
Recommended increment: 2

Heightheightheight (input_control) extent.y โ†’ (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of the filter mask.

Default: 99
Suggested values: 3, 5, 7, 9, 11, 13, 17, 21, 29, 41, 51, 73, 1013, 5, 7, 9, 11, 13, 17, 21, 29, 41, 51, 73, 101
Value range: 1 โ‰ค Height
Minimum increment: 2
Recommended increment: 2

Example๐Ÿ”—

(C)

highpass_image(Image,&Highpass,7,5)\;
threshold(Highpass,&Region,60.0,255.0)\;
skeleton(Region,&Skeleton)\;

Result๐Ÿ”—

highpass_imageHighpassImage returns 2 (H_MSG_TRUE) if all parameters are correct. If the input is empty the behavior can be set via set_system('no_object_result',<Result>). If necessary, an exception is raised.

Combinations with other operators๐Ÿ”—

Combinations

Possible successors

thresholdThreshold, skeletonSkeleton

Alternatives

mean_imageMeanImage, sub_imageSubImage, convol_imageConvolImage, bandpass_imageBandpassImage

See also

dyn_thresholdDynThreshold

Module๐Ÿ”—

Foundation