div_imagediv_imageDivImageDivImagediv_image (算子)

名称

div_imagediv_imageDivImageDivImagediv_image — 除两幅图像。

签名

div_image(Image1, Image2 : ImageResult : Mult, Add : )

Herror div_image(const Hobject Image1, const Hobject Image2, Hobject* ImageResult, double Mult, double Add)

Herror T_div_image(const Hobject Image1, const Hobject Image2, Hobject* ImageResult, const Htuple Mult, const Htuple Add)

void DivImage(const HObject& Image1, const HObject& Image2, HObject* ImageResult, const HTuple& Mult, const HTuple& Add)

HImage HImage::DivImage(const HImage& Image2, const HTuple& Mult, const HTuple& Add) const

HImage HImage::DivImage(const HImage& Image2, double Mult, double Add) const

static void HOperatorSet.DivImage(HObject image1, HObject image2, out HObject imageResult, HTuple mult, HTuple add)

HImage HImage.DivImage(HImage image2, HTuple mult, HTuple add)

HImage HImage.DivImage(HImage image2, double mult, double add)

def div_image(image_1: HObject, image_2: HObject, mult: Union[int, float], add: Union[int, float]) -> HObject

描述

算子 div_imagediv_imageDivImageDivImageDivImagediv_image divides two images. The gray values (g1,g2) of the input images (Image1Image1Image1Image1image1image_1) are transformed as follows: g' := g1 / g2 * Mult + Add 若发生溢出或下溢,数值将被截断。 For a division by zero the result is set to zero.

单次调用可处理多张图像。此时两个输入参数包含相同数量的图像,这些图像将成对进行处理。每处理一对图像,系统将生成一张输出图像。

div_imagediv_imageDivImageDivImageDivImagediv_image can be executed on an OpenCL device for byte, int1, int2, uint2, int4, real and complex images. However, since for OpenCL 1.0 only single precision floating point is supported for all devices, and not all rounding modes are supported, the OpenCL implementation can produce slightly different results from the scalar implementation.

执行信息

参数

Image1Image1Image1Image1image1image_1 (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / complex*) *允许用于计算设备

图像 1。

Image2Image2Image2Image2image2image_2 (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / complex*) *允许用于计算设备

图像 2。

ImageResultImageResultImageResultImageResultimageResultimage_result (输出对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / int1 / int2 / uint2 / int4 / int8 / real / complex)

Result image(s) by the division.

MultMultMultMultmultmult (输入控制)  number HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Factor for gray range adaption.

默认值: 255

建议值: 0.1, 0.2, 0.5, 1.0, 2.0, 3.0, 10, 100, 500, 1000

值范围: -1000 ≤ Mult Mult Mult Mult mult mult ≤ 1000

最小增量: 0.001

建议增量: 1

AddAddAddAddaddadd (输入控制)  number HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)

Value for gray range adaption.

默认值: 0

建议值: 0.0, 128.0, 256.0, 1025

值范围: -1000 ≤ Add Add Add Add add add ≤ 1000

最小增量: 0.01

建议增量: 1.0

示例(HDevelop)

read_image(Image1,'fabrik')
dev_display (Image1)
read_image(Image2,'monkey')
dev_display (Image2)
div_image (Image1, Image2, Result, 200, 10)
dev_display (Result)

示例(C)

read_image(&Image1,"fabrik");
disp_image(Image1,WindowHandle);
read_image(&Image2,"monkey");
disp_image(Image2,WindowHandle);
div_image(Image1,Image2,&Result,200.0,10.0);
disp_image(Result,WindowHandle);

示例(HDevelop)

read_image(Image1,'fabrik')
dev_display (Image1)
read_image(Image2,'monkey')
dev_display (Image2)
div_image (Image1, Image2, Result, 200, 10)
dev_display (Result)

示例(HDevelop)

read_image(Image1,'fabrik')
dev_display (Image1)
read_image(Image2,'monkey')
dev_display (Image2)
div_image (Image1, Image2, Result, 200, 10)
dev_display (Result)

示例(HDevelop)

read_image(Image1,'fabrik')
dev_display (Image1)
read_image(Image2,'monkey')
dev_display (Image2)
div_image (Image1, Image2, Result, 200, 10)
dev_display (Result)

结果

算子 div_imagediv_imageDivImageDivImageDivImagediv_image 在参数正确时返回值 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>)。如有必要,则抛出异常。

替代

add_imageadd_imageAddImageAddImageAddImageadd_image, sub_imagesub_imageSubImageSubImageSubImagesub_image, mult_imagemult_imageMultImageMultImageMultImagemult_image

另见

add_imageadd_imageAddImageAddImageAddImageadd_image, sub_imagesub_imageSubImageSubImageSubImagesub_image, mult_imagemult_imageMultImageMultImageMultImagemult_image

模块

基础