Herror ::bit_and (
    Hobject Image1,
    Hobject Image2,
    Hobject *ImageAnd
)
HImage HImage::BitAnd (
    const HImageArray &Image2
) const
HImageArray HImageArray::BitAnd (
    const HImageArray &Image2
) const

Bit-by-bit AND of all pixels of the input images.

The operator ::bit_and calculates the ``and'' of all pixels of the input images bit by bit. The semantics of the ``and'' operation corresponds to that of C for the respective types (signed char, unsigned char, short, int/long). The images must have the same size and pixel type. The pixels within the definition range of the image in the first parameter are processed.

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.


Parameters

Image1 (input_object)
(multichannel-)image(-array) -> Hobject: HImage(Array) ( byte / int1 / int2 / int4 )
Input image(s) 1.

Image2 (input_object)
(multichannel-)image(-array) -> Hobject: HImage(Array) ( byte / int1 / int2 / int4 )
Input image(s) 2.

ImageAnd (output_object)
(multichannel-)image(-array) -> Hobject * : HImage(Array) ( byte / int1 / int2 / int4 )
Result image(s) by AND-operation.


Example
read_image(&Image0,"affe");
disp_image(Image0,WindowHandle);
read_image(&Image1,"fabrik");
disp_image(Image1,WindowHandle);
bit_and(Image0,Image1,&ImageBitA);
disp_image(ImageBitA,WindowHandle); 

Result

If the images are correct (type and number) the operator ::bit_and returns the value H_MSG_TRUE. 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.


Alternatives

::bit_mask, ::add_image, ::max_image


See also

::bit_mask, ::add_image, ::max_image


Module

Image filters



Copyright © 1996-2002 MVTec Software GmbH