Skip to content

emphasizeEmphasizeEmphasizeemphasizeemphasize🔗

Short description🔗

emphasizeEmphasizeEmphasizeemphasizeemphasize — Enhance contrast of the image.

Signature🔗

emphasize( image Image, out image ImageEmphasize, extent.x MaskWidth, extent.y MaskHeight, real Factor )void Emphasize( const HObject& Image, HObject* ImageEmphasize, const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& Factor )static void HOperatorSet.Emphasize( HObject image, out HObject imageEmphasize, HTuple maskWidth, HTuple maskHeight, HTuple factor )def emphasize( image: HObject, mask_width: int, mask_height: int, factor: float ) -> HObject

Herror emphasize( const Hobject Image, Hobject* ImageEmphasize, const Hlong MaskWidth, const Hlong MaskHeight, double Factor )

Herror T_emphasize( const Hobject Image, Hobject* ImageEmphasize, const Htuple MaskWidth, const Htuple MaskHeight, const Htuple Factor )

HImage HImage::Emphasize( Hlong MaskWidth, Hlong MaskHeight, double Factor ) const

HImage HImage.Emphasize( int maskWidth, int maskHeight, double factor )

Description🔗

The operator emphasizeEmphasize emphasizes high frequency areas of the image (edges and corners). The resulting images appears sharper.

First the procedure carries out a filtering with the low pass (mean_imageMeanImage). The resulting gray values (\(res\)) are calculated from the obtained gray values (\(mean\)) and the original gray values (\(orig\)) as follows: res := round((orig - mean) * Factor) + orig Factorfactorfactor serves as measurement of the increase in contrast. The division frequency is determined via the size of the filter matrix: The larger the matrix, the lower the division frequency.

As an edge treatment the gray values are mirrored at the edges of the image. Overflow and/or underflow of gray values is clipped.

Attention🔗

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

Image to be enhanced.

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

contrast enhanced image.

MaskWidthmaskWidthmask_width (input_control) extent.x → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Width of low pass mask.

Default: 77
Suggested values: 3, 5, 7, 9, 11, 15, 21, 25, 31, 393, 5, 7, 9, 11, 15, 21, 25, 31, 39
Value range: 3 ≤ MaskWidth
Minimum increment: 2
Recommended increment: 2

MaskHeightmaskHeightmask_height (input_control) extent.y → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Height of the low pass mask.

Default: 77
Suggested values: 3, 5, 7, 9, 11, 15, 21, 25, 31, 393, 5, 7, 9, 11, 15, 21, 25, 31, 39
Value range: 3 ≤ MaskHeight
Minimum increment: 2
Recommended increment: 2

Factorfactorfactor (input_control) real → (real)HTuple (double)HTuple (double)floatHtuple (double)

Intensity of contrast emphasis.

Default: 1.01.0
Suggested values: 0.3, 0.5, 0.7, 1.0, 1.4, 1.8, 2.00.3, 0.5, 0.7, 1.0, 1.4, 1.8, 2.0
Value range: 0.0 ≤ Factor (sqrt)
Recommended increment: 0.2

Example🔗

(HDevelop)

read_image(Image,'mreut')
dev_display (Image)
draw_region(Region,WindowHandle)
reduce_domain(Image,Region,Mask)
emphasize(Mask,Sharp,7,7,2.0)
dev_display (Sharp)
(C)
read_image(&Image,"mreut")\;
disp_image(Image,WindowHandle)\;
draw_region(&Region,WindowHandle)\;
reduce_domain(Image,Region,&Mask)\;
emphasize(Mask,&Sharp,7,7,2.0)\;
disp_image(Sharp,WindowHandle)\;

Result🔗

If the parameter values are correct the operator emphasizeEmphasize returns the value 2 (H_MSG_TRUE) The behavior in case of empty input (no input images available) is set via the operator set_system(::'no_object_result',<Result>:). If necessary an exception is raised.

Combinations with other operators🔗

Combinations

Possible successors

disp_imageDispImage

Alternatives

mean_imageMeanImage, sub_imageSubImage, laplaceLaplace, add_imageAddImage

See also

mean_imageMeanImage, highpass_imageHighpassImage

Module🔗

Foundation