Herror ::sub_image (
    Hobject ImageMinuend,
    Hobject ImageSubtrahend,
    Hobject *ImageSub,
    const HTuple &Mult,
    const HTuple &Add
)
HImage HImage::SubImage (
    const HImageArray &ImageSubtrahend,
    const HTuple &Mult,
    const HTuple &Add
) const
HImageArray HImageArray::SubImage (
    const HImageArray &ImageSubtrahend,
    const HTuple &Mult,
    const HTuple &Add
) const

Subtract two images.

The operator ::sub_image subtracts two images. The gray values (g1,g2) g' := (g1 - g2) * Mult + Add


Parameters

ImageMinuend (input_object)
(multichannel-)image(-array) -> Hobject: HImage(Array) ( byte / int1 / int2 / int4 / real / direction / cyclic / complex )
Minuend(s).

ImageSubtrahend (input_object)
(multichannel-)image(-array) -> Hobject: HImage(Array) ( byte / int1 / int2 / int4 / real / direction / cyclic / complex )
Subtrahend(s).

ImageSub (output_object)
(multichannel-)image(-array) -> Hobject * : HImage(Array) ( byte / int1 / int2 / int4 / real / direction / cyclic / complex )
Result image(s) by the subtraction.

Mult (input_control)
number -> HTuple.double / long
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 <= 255.0
Minimum increment: 0.001
Recommended increment: 0.1

Add (input_control)
number -> HTuple.double / long
Correction value.
Default value: 128.0
Suggested values: 0.0, 128.0, 256.0
Typical range of values: -512.0 <= Add <= 512.0
Minimum increment: 0.01
Recommended increment: 1.0


Example
read_image(&Image0,"fabrik");
disp_image(Image0,WindowHandle);
read_image(&Image1,"Affe");
disp_image(Image1,WindowHandle);
sub_image(Image0,Image1,&Result,2.0,10.0);
disp_image(Result,WindowHandle); 

Result

The operator ::sub_image returns the value 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 handling is raised.


Possible Successors

::dual_threshold


Alternatives

::mult_image, ::add_image, ::sub_image


See also

::add_image, ::mult_image, ::dyn_threshold, ::check_difference


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH