illuminateilluminateIlluminateIlluminateilluminate (算子)

名称

illuminateilluminateIlluminateIlluminateilluminate — 照亮图像。

签名

illuminate(Image : ImageIlluminate : MaskWidth, MaskHeight, Factor : )

Herror illuminate(const Hobject Image, Hobject* ImageIlluminate, const Hlong MaskWidth, const Hlong MaskHeight, double Factor)

Herror T_illuminate(const Hobject Image, Hobject* ImageIlluminate, const Htuple MaskWidth, const Htuple MaskHeight, const Htuple Factor)

void Illuminate(const HObject& Image, HObject* ImageIlluminate, const HTuple& MaskWidth, const HTuple& MaskHeight, const HTuple& Factor)

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

static void HOperatorSet.Illuminate(HObject image, out HObject imageIlluminate, HTuple maskWidth, HTuple maskHeight, HTuple factor)

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

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

描述

算子 illuminateilluminateIlluminateIlluminateIlluminateilluminate enhances contrast. Very dark parts of the image are “illuminated” more strongly, very light ones are “darkened”. If orig is the original gray value and mean is the corresponding gray value of the low pass filtered image detected via the operators mean_imagemean_imageMeanImageMeanImageMeanImagemean_image and filter size MaskHeightMaskHeightMaskHeightMaskHeightmaskHeightmask_height x MaskWidthMaskWidthMaskWidthMaskWidthmaskWidthmask_width. For byte-images val equals 127, for int2-images and uint2-images val equals the median value. The resulting gray value is new: new = round ( (val - mean) * Factor + orig ). The low pass should have rather large dimensions (30 x 30 to 200 x 200). Reasonable parameter combinations might be: Height Width Factor --------------------- 40 40 0.55 100 100 0.7 150 150 0.8 i.e. the larger the low pass mask is chosen, the larger FactorFactorFactorFactorfactorfactor should be as well.

The following “spotlight effect” should be noted: If, for example, a dark object is in front of a light wall the object as well as the wall, which is already light in the immediate proximity of the object contours, are lightened by the operator illuminateilluminateIlluminateIlluminateIlluminateilluminate. This corresponds roughly to the effect that is produced when the object is illuminated by a strong spotlight. The same applies to light objects in front of a darker background. In this case, however, the fictitious “spotlight” darkens objects.

注意

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

执行信息

参数

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

Image to be enhanced.

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

“Illuminated” image.

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

Width of low pass mask.

默认值: 101

建议值: 31, 41, 51, 71, 101, 121, 151, 201

最小增量: 2

建议增量: 10

限制: MaskWidth < width(Image) * 2

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

Height of low pass mask.

默认值: 101

建议值: 31, 41, 51, 71, 101, 121, 151, 201

最小增量: 2

建议增量: 10

限制: MaskHeight < height(Image) * 2

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

Scales the “correction gray value” added to the original gray values.

默认值: 0.7

建议值: 0.3, 0.5, 0.7, 1.0, 1.5, 2.0, 3.0, 5.0

值范围: 0.0 ≤ Factor Factor Factor Factor factor factor

最小增量: 0.01

建议增量: 0.2

示例(HDevelop)

read_image(Image,'fabrik')
dev_display (Image)
illuminate(Image,Better,40,40,0.55)
dev_display (Better)

示例(C)

read_image(&Image,"fabrik");
disp_image(Image,WindowHandle);
illuminate(Image,&Better,40,40,0.55);
disp_image(Better,WindowHandle); 

示例(HDevelop)

read_image(Image,'fabrik')
dev_display (Image)
illuminate(Image,Better,40,40,0.55)
dev_display (Better)

示例(HDevelop)

read_image(Image,'fabrik')
dev_display (Image)
illuminate(Image,Better,40,40,0.55)
dev_display (Better)

示例(HDevelop)

read_image(Image,'fabrik')
dev_display (Image)
illuminate(Image,Better,40,40,0.55)
dev_display (Better)

结果

如果参数值正确,算子 illuminateilluminateIlluminateIlluminateIlluminateilluminate 返回值 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

替代

scale_image_maxscale_image_maxScaleImageMaxScaleImageMaxScaleImageMaxscale_image_max, equ_histo_imageequ_histo_imageEquHistoImageEquHistoImageEquHistoImageequ_histo_image, equ_histo_image_rectequ_histo_image_rectEquHistoImageRectEquHistoImageRectEquHistoImageRectequ_histo_image_rect, mean_imagemean_imageMeanImageMeanImageMeanImagemean_image, sub_imagesub_imageSubImageSubImageSubImagesub_image

另见

emphasizeemphasizeEmphasizeEmphasizeEmphasizeemphasize, gray_histogray_histoGrayHistoGrayHistoGrayHistogray_histo

模块

基础