emphasizeemphasizeEmphasizeEmphasizeemphasize (算子)

名称

emphasizeemphasizeEmphasizeEmphasizeemphasize — 增强图像的对比度。

签名

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)

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

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

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

def emphasize(image: HObject, mask_width: int, mask_height: int, factor: float) -> HObject

描述

算子 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_imageMeanImageMeanImageMeanImagemean_image). 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 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.

注意

请注意,若使用域缩减后的图像作为输入,滤波器算子可能会返回意外结果。请参阅 滤波器 一章

执行信息

参数

ImageImageImageImageimageimage (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte / int2 / uint2)

Image to be enhanced.

ImageEmphasizeImageEmphasizeImageEmphasizeImageEmphasizeimageEmphasizeimage_emphasize (输出对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / int2 / uint2)

contrast enhanced image.

MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width (输入控制)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of low pass mask.

默认值: 7

建议值: 3, 5, 7, 9, 11, 15, 21, 25, 31, 39

值范围: 3 ≤ MaskWidth MaskWidth MaskWidth MaskWidth maskWidth mask_width

最小增量: 2

建议增量: 2

MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height (输入控制)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of the low pass mask.

默认值: 7

建议值: 3, 5, 7, 9, 11, 15, 21, 25, 31, 39

值范围: 3 ≤ MaskHeight MaskHeight MaskHeight MaskHeight maskHeight mask_height

最小增量: 2

建议增量: 2

FactorFactorFactorFactorfactorfactor (输入控制)  real HTuplefloatHTupleHtuple (real) (double) (double) (double)

Intensity of contrast emphasis.

默认值: 1.0

建议值: 0.3, 0.5, 0.7, 1.0, 1.4, 1.8, 2.0

值范围: 0.0 ≤ Factor Factor Factor Factor factor factor (sqrt)

建议增量: 0.2

示例(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);

示例(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)

示例(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)

示例(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)

结果

如果参数值正确,算子 emphasizeemphasizeEmphasizeEmphasizeEmphasizeemphasize 返回值 2 ( H_MSG_TRUE)当输入为空(无可用输入图像)时可设置行为通过算子 set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的后继

disp_imagedisp_imageDispImageDispImageDispImagedisp_image

替代

mean_imagemean_imageMeanImageMeanImageMeanImagemean_image, sub_imagesub_imageSubImageSubImageSubImagesub_image, laplacelaplaceLaplaceLaplaceLaplacelaplace, add_imageadd_imageAddImageAddImageAddImageadd_image

另见

mean_imagemean_imageMeanImageMeanImageMeanImagemean_image, highpass_imagehighpass_imageHighpassImageHighpassImageHighpassImagehighpass_image

模块

基础