Name
sub_imagesub_imageSubImagesub_imageSubImageSubImage — Subtract two images.
The operator sub_imagesub_imageSubImagesub_imageSubImageSubImage subtracts two images. The gray values
(g1,g2) of the input images (ImageMinuendImageMinuendImageMinuendImageMinuendImageMinuendimageMinuend and
ImageSubtrahendImageSubtrahendImageSubtrahendImageSubtrahendImageSubtrahendimageSubtrahend) 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.
Please note that the runtime of the operator varies with different
control parameters. For frequently used combinations special
optimizations are used. Additionally, for byte, int2, and uint2
images special optimizations are implemented that use SIMD technology.
The actual application of these special optimizations is controlled by the
system parameter 'mmx_enable'"mmx_enable""mmx_enable""mmx_enable""mmx_enable""mmx_enable" (see set_systemset_systemSetSystemset_systemSetSystemSetSystem).
If 'mmx_enable'"mmx_enable""mmx_enable""mmx_enable""mmx_enable""mmx_enable" is set to 'true'"true""true""true""true""true" (and the SIMD
instruction set is available), the internal calculations are performed
using SIMD technology.
sub_imagesub_imageSubImagesub_imageSubImageSubImage 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 or SIMD
implementations.
Note that the acceleration gained by SIMD technology is highest on large,
compact input regions. However, in rare cases, the execution of
sub_imagesub_imageSubImagesub_imageSubImageSubImage might take significantly longer with SIMD technology
than without, depending on the input region and the capabilities of
the hardware. In these cases, the use of SIMD
technology can be avoided by set_system(::'mmx_enable','false':)set_system("mmx_enable","false")SetSystem("mmx_enable","false")set_system("mmx_enable","false")SetSystem("mmx_enable","false")SetSystem("mmx_enable","false").
- 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 tuple level.
- Automatically parallelized on channel level.
- Automatically parallelized on domain level.
Result image(s) by the subtraction.
MultMultMultMultMultmult (input_control) number → HTupleHTupleHTupleVARIANTHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong) (double / Hlong) (double / Hlong)
Correction factor.
Default value: 1.0
Suggested values: 0.0, 1.0, 2.0, 3.0, 4.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)
Correction value.
Default value: 128.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
read_image(Image0,'fabrik')
disp_image(Image0,WindowHandle)
read_image(Image1,'monkey')
disp_image(Image1,WindowHandle)
sub_image(Image0,Image1,Result,2.0,10.0)
disp_image(Result,WindowHandle)
read_image(&Image0,"fabrik");
disp_image(Image0,WindowHandle);
read_image(&Image1,"monkey");
disp_image(Image1,WindowHandle);
sub_image(Image0,Image1,&Result,2.0,10.0);
disp_image(Result,WindowHandle);
read_image(Image0,'fabrik')
disp_image(Image0,WindowHandle)
read_image(Image1,'monkey')
disp_image(Image1,WindowHandle)
sub_image(Image0,Image1,Result,2.0,10.0)
disp_image(Result,WindowHandle)
read_image(Image0,'fabrik')
disp_image(Image0,WindowHandle)
read_image(Image1,'monkey')
disp_image(Image1,WindowHandle)
sub_image(Image0,Image1,Result,2.0,10.0)
disp_image(Result,WindowHandle)
read_image(Image0,'fabrik')
disp_image(Image0,WindowHandle)
read_image(Image1,'monkey')
disp_image(Image1,WindowHandle)
sub_image(Image0,Image1,Result,2.0,10.0)
disp_image(Result,WindowHandle)
read_image(Image0,'fabrik')
disp_image(Image0,WindowHandle)
read_image(Image1,'monkey')
disp_image(Image1,WindowHandle)
sub_image(Image0,Image1,Result,2.0,10.0)
disp_image(Result,WindowHandle)
The operator sub_imagesub_imageSubImagesub_imageSubImageSubImage 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.
dual_thresholddual_thresholdDualThresholddual_thresholdDualThresholdDualThreshold
mult_imagemult_imageMultImagemult_imageMultImageMultImage,
add_imageadd_imageAddImageadd_imageAddImageAddImage
add_imageadd_imageAddImageadd_imageAddImageAddImage,
mult_imagemult_imageMultImagemult_imageMultImageMultImage,
dyn_thresholddyn_thresholdDynThresholddyn_thresholdDynThresholdDynThreshold,
check_differencecheck_differenceCheckDifferencecheck_differenceCheckDifferenceCheckDifference
Foundation