div_imageš
Short descriptionš
div_image ā Divide two images.
Signatureš
div_image( image Image1, image Image2, out image ImageResult, number Mult, number Add )
Descriptionš
The operator div_image divides two images. The gray values
(g1,g2) of the input images (Image1) are
transformed as follows:
gā := g1 / g2 * Mult + Add
If an overflow or an underflow occurs the values are clipped.
For a division by zero the result is set to zero.
* 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.
div_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.
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š
Image1 (input_object) (multichannel-)image(-array) ā object (byte* / int1* / int2* / uint2* / int4* / int8 / real* / complex*) *allowed for compute devices
Image(s) 1.
Image2 (input_object) (multichannel-)image(-array) ā object (byte* / int1* / int2* / uint2* / int4* / int8 / real* / complex*) *allowed for compute devices
Image(s) 2.
ImageResult (output_object) (multichannel-)image(-array) ā object (byte / int1 / int2 / uint2 / int4 / int8 / real / complex)
Result image(s) by the division.
Mult (input_control) number ā (real / integer)
Factor for gray range adaption.
Default: 255
Suggested values: 0.1, 0.2, 0.5, 1.0, 2.0, 3.0, 10, 100, 500, 1000
Value range: -1000 ⤠Mult ⤠1000
Minimum increment: 0.001
Recommended increment: 1
Add (input_control) number ā (real / integer)
Value for gray range adaption.
Default: 0
Suggested values: 0.0, 128.0, 256.0, 1025
Value range: -1000 ⤠Add ⤠1000
Minimum increment: 0.01
Recommended increment: 1.0
Exampleš
(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)
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)\;
Resultš
The operator div_image 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š
Moduleš
Foundation