Skip to content

mult_imageMultImageMultImagemult_imagemult_imagešŸ”—

Short descriptionšŸ”—

mult_imageMultImageMultImagemult_imagemult_image — Multiply two images.

SignaturešŸ”—

mult_image( image Image1, image Image2, out image ImageResult, number Mult, number Add )void MultImage( const HObject& Image1, const HObject& Image2, HObject* ImageResult, const HTuple& Mult, const HTuple& Add )static void HOperatorSet.MultImage( HObject image1, HObject image2, out HObject imageResult, HTuple mult, HTuple add )def mult_image( image_1: HObject, image_2: HObject, mult: Union[int, float], add: Union[int, float] ) -> HObject

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 )

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

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

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

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

DescriptionšŸ”—

mult_imageMultImage multiplies two images. The gray values (g1,g2) of the input images (Image1image1image_1) 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_imageMultImage 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.

Execution informationšŸ”—

Execution information
  • Supports OpenCL compute devices.

  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on domain level.

ParametersšŸ”—

Image1image1image_1 (input_object) (multichannel-)image(-array) → object (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*)HObject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*)HImage (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*)HObject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*)Hobject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*) *allowed for compute devices

Image(s) 1.

Image2image2image_2 (input_object) (multichannel-)image(-array) → object (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*)HObject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*)HImage (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*)HObject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*)Hobject (byte* / int1* / int2* / uint2* / int4* / int8 / real* / direction* / cyclic* / complex*) *allowed for compute devices

Image(s) 2.

ImageResultimageResultimage_result (output_object) (multichannel-)image(-array) → object (byte / int1 / int2 / uint2 / int4 / int8 / real / direction / cyclic / complex)HObject (byte / int1 / int2 / uint2 / int4 / int8 / real / direction / cyclic / complex)HImage (byte / int1 / int2 / uint2 / int4 / int8 / real / direction / cyclic / complex)HObject (byte / int1 / int2 / uint2 / int4 / int8 / real / direction / cyclic / complex)Hobject * (byte / int1 / int2 / uint2 / int4 / int8 / real / direction / cyclic / complex)

Result image(s) by the product.

Multmultmult (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Factor for gray range adaption.

Default: 0.0050.005
Suggested values: 0.001, 0.01, 0.5, 1.0, 2.0, 3.0, 5.0, 10.00.001, 0.01, 0.5, 1.0, 2.0, 3.0, 5.0, 10.0
Value range: -255.0 ≤ Mult ≤ 255.0
Minimum increment: 0.001
Recommended increment: 0.1

Addaddadd (input_control) number → (real / integer)HTuple (double / Hlong)HTuple (double / int / long)Union[int, float]Htuple (double / Hlong)

Value for gray range adaption.

Default: 00
Suggested values: 0.0, 128.0, 256.00.0, 128.0, 256.0
Value range: -512.0 ≤ Add ≤ 512.0
Minimum increment: 0.01
Recommended increment: 1.0

ExamplešŸ”—

(HDevelop)

read_image(Image1,'fabrik')
dev_display (Image1)
read_image(Image2,'monkey')
dev_display (Image2)
mult_image (Image1, Image2, Result, 0.01, 10)
dev_display (Result)
(C)
read_image(&Image1,"fabrik")\;
disp_image(Image1,WindowHandle)\;
read_image(&Image2,"monkey")\;
disp_image(Image2,WindowHandle)\;
mult_image(Image1,Image2,&Result,0.01,10.0)\;
disp_image(Result,WindowHandle)\;

ResultšŸ”—

The operator mult_imageMultImage 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>:) If necessary an exception is raised.

Combinations with other operatorsšŸ”—

Combinations

Alternatives

add_imageAddImage, sub_imageSubImage, div_imageDivImage

See also

add_imageAddImage, sub_imageSubImage, div_imageDivImage

ModulešŸ”—

Foundation