ClassesClassesClassesClasses | | | | Operators

emphasizeemphasizeEmphasizeemphasizeEmphasizeEmphasize (Operator)

Name

emphasizeemphasizeEmphasizeemphasizeEmphasizeEmphasize — Enhance contrast of the image.

Signature

emphasize(Image : ImageEmphasize : MaskWidth, MaskHeight, Factor : )

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)

Herror emphasize(Hobject Image, Hobject* ImageEmphasize, const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& Factor)

HImage HImage::Emphasize(const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& Factor) const

HImageArray HImageArray::Emphasize(const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& Factor) const

void 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

void HOperatorSetX.Emphasize(
[in] IHUntypedObjectX* Image, [out] IHUntypedObjectX*ImageEmphasize, [in] VARIANT MaskWidth, [in] VARIANT MaskHeight, [in] VARIANT Factor)

IHImageX* HImageX.Emphasize(
[in] Hlong MaskWidth, [in] Hlong MaskHeight, [in] double Factor)

static void HOperatorSet.Emphasize(HObject image, out HObject imageEmphasize, HTuple maskWidth, HTuple maskHeight, HTuple factor)

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

Description

The operator emphasizeemphasizeEmphasizeemphasizeEmphasizeEmphasize 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_imagemean_imageMeanImagemean_imageMeanImageMeanImage). 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
 
FactorFactorFactorFactorFactorfactor 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 disivion 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.

Parallelization

Parameters

ImageImageImageImageImageimage (input_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject (byte / int2 / uint2)

Image to be enhanced.

ImageEmphasizeImageEmphasizeImageEmphasizeImageEmphasizeImageEmphasizeimageEmphasize (output_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject * (byte / int2 / uint2)

contrast enhanced image.

MaskWidthMaskWidthMaskWidthMaskWidthMaskWidthmaskWidth (input_control)  extent.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Width of low pass mask.

Default value: 7

Suggested values: 3, 5, 7, 9, 11, 15, 21, 25, 31, 39

Typical range of values: 3 ≤ MaskWidth MaskWidth MaskWidth MaskWidth MaskWidth maskWidth ≤ 201

Minimum increment: 2

Recommended increment: 2

MaskHeightMaskHeightMaskHeightMaskHeightMaskHeightmaskHeight (input_control)  extent.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Height of the low pass mask.

Default value: 7

Suggested values: 3, 5, 7, 9, 11, 15, 21, 25, 31, 39

Typical range of values: 3 ≤ MaskHeight MaskHeight MaskHeight MaskHeight MaskHeight maskHeight ≤ 201

Minimum increment: 2

Recommended increment: 2

FactorFactorFactorFactorFactorfactor (input_control)  real HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Intensity of contrast emphasis.

Default value: 1.0

Suggested values: 0.3, 0.5, 0.7, 1.0, 1.4, 1.8, 2.0

Typical range of values: 0.0 ≤ Factor Factor Factor Factor Factor factor ≤ 20.0 (sqrt)

Minimum increment: 0.01

Recommended increment: 0.2

Restriction: 0 < Factor && Factor < 20

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)

Example (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);

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)

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)

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)

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)

Result

If the parameter values are correct the operator emphasizeemphasizeEmphasizeemphasizeEmphasizeEmphasize 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>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary an exception is raised.

Possible Successors

disp_imagedisp_imageDispImagedisp_imageDispImageDispImage

Alternatives

mean_imagemean_imageMeanImagemean_imageMeanImageMeanImage, sub_imagesub_imageSubImagesub_imageSubImageSubImage, laplacelaplaceLaplacelaplaceLaplaceLaplace, add_imageadd_imageAddImageadd_imageAddImageAddImage

See also

mean_imagemean_imageMeanImagemean_imageMeanImageMeanImage, highpass_imagehighpass_imageHighpassImagehighpass_imageHighpassImageHighpassImage

Module

Foundation


ClassesClassesClassesClasses | | | | Operators