ClassesClassesClassesClasses | | | | Operators

mult_imagemult_imageMultImagemult_imageMultImageMultImage (Operator)

Name

mult_imagemult_imageMultImagemult_imageMultImageMultImage — Multiply two images.

Signature

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

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

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

Herror mult_image(Hobject Image1, Hobject Image2, Hobject* ImageResult, const HTuple& Mult, const HTuple& Add)

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

HImageArray HImageArray::MultImage(const HImageArray& Image2, const HTuple& Mult, const HTuple& Add) const

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

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

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

void HOperatorSetX.MultImage(
[in] IHUntypedObjectX* Image1, [in] IHUntypedObjectX* Image2, [out] IHUntypedObjectX*ImageResult, [in] VARIANT Mult, [in] VARIANT Add)

IHImageX* HImageX.MultImage(
[in] IHImageX* Image2, [in] VARIANT Mult, [in] VARIANT Add)

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

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

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

Description

mult_imagemult_imageMultImagemult_imageMultImageMultImage multiplies two images. The gray values (g1,g2) of the input images (Image1Image1Image1Image1Image1image1) are transformed as follows:

                g' := g1 * g2 * Mult + Add

If an overflow or an underflow occurs the values are clipped. Note that this is not the case with cyclic and direction images.

Several images can be processed in one call. In this case both input parameters contain the same number of images which are then processed in pairs. An output image is generated for every pair.

mult_imagemult_imageMultImagemult_imageMultImageMultImage can be executed on an OpenCL device for byte, int1, int2, uint2, int4, real, direction, cyclic, 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.

Parallelization

Parameters

Image1Image1Image1Image1Image1image1 (input_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*) *allowed for compute devices

Image(s) 1.

Image2Image2Image2Image2Image2image2 (input_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*) *allowed for compute devices

Image(s) 2.

ImageResultImageResultImageResultImageResultImageResultimageResult (output_object)  (multichannel-)image(-array) objectHImageHImageHImageHImageXHobject * (byte / int1 / int2 / uint2 / int4 / int8 / real / direction / cyclic / complex)

Result image(s) by the product.

MultMultMultMultMultmult (input_control)  number HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Factor for gray range adaption.

Default value: 0.005

Suggested values: 0.001, 0.01, 0.5, 1.0, 2.0, 3.0, 5.0, 10.0

Typical range of values: -255.0 ≤ Mult Mult Mult Mult Mult mult ≤ 255.0

Minimum increment: 0.001

Recommended increment: 0.1

AddAddAddAddAddadd (input_control)  number HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)

Value for gray range adaption.

Default value: 0

Suggested values: 0.0, 128.0, 256.0

Typical range of values: -512.0 ≤ Add Add Add Add Add add ≤ 512.0

Minimum increment: 0.01

Recommended increment: 1.0

Example (HDevelop)

read_image(Image0,'fabrik')
disp_image(Image0,WindowHandle)
read_image(Image1,'monkey')
disp_image(Image1,WindowHandle)
mult_image(Image0,Image1,Result,2.0,10.0)
disp_image(Result,WindowHandle)

Example (C)

read_image(&Image0,"fabrik");
disp_image(Image0,WindowHandle);
read_image(&Image1,"monkey");
disp_image(Image1,WindowHandle);
mult_image(Image0,Image1,&Result,2.0,10.0);
disp_image(Result,WindowHandle);

Example (HDevelop)

read_image(Image0,'fabrik')
disp_image(Image0,WindowHandle)
read_image(Image1,'monkey')
disp_image(Image1,WindowHandle)
mult_image(Image0,Image1,Result,2.0,10.0)
disp_image(Result,WindowHandle)

Example (HDevelop)

read_image(Image0,'fabrik')
disp_image(Image0,WindowHandle)
read_image(Image1,'monkey')
disp_image(Image1,WindowHandle)
mult_image(Image0,Image1,Result,2.0,10.0)
disp_image(Result,WindowHandle)

Example (HDevelop)

read_image(Image0,'fabrik')
disp_image(Image0,WindowHandle)
read_image(Image1,'monkey')
disp_image(Image1,WindowHandle)
mult_image(Image0,Image1,Result,2.0,10.0)
disp_image(Result,WindowHandle)

Example (HDevelop)

read_image(Image0,'fabrik')
disp_image(Image0,WindowHandle)
read_image(Image1,'monkey')
disp_image(Image1,WindowHandle)
mult_image(Image0,Image1,Result,2.0,10.0)
disp_image(Result,WindowHandle)

Result

The operator mult_imagemult_imageMultImagemult_imageMultImageMultImage returns the value 2 (H_MSG_TRUE) if the parameters are correct. 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.

Alternatives

add_imageadd_imageAddImageadd_imageAddImageAddImage, sub_imagesub_imageSubImagesub_imageSubImageSubImage, div_imagediv_imageDivImagediv_imageDivImageDivImage

See also

add_imageadd_imageAddImageadd_imageAddImageAddImage, sub_imagesub_imageSubImagesub_imageSubImageSubImage, div_imagediv_imageDivImagediv_imageDivImageDivImage

Module

Foundation


ClassesClassesClassesClasses | | | | Operators