The Logical Operations category contains logical operations between two images
or between an image and a constant as union, intersection, complementary.
More...
Classes | |
class | SoBitShiftProcessing |
![]() | |
class | SoInvertImageProcessing |
![]() | |
class | SoLogicalImageProcessing |
![]() | |
class | SoLogicalNotProcessing |
![]() | |
class | SoLogicalValueProcessing |
![]() | |
The Logical Operations category contains logical operations between two images
or between an image and a constant as union, intersection, complementary.
Logical operations are usually performed on binary images, but may also be applied to grayscale images. In a binary image, a pixel/voxel with value 1 has the value true and a pixel/voxel with value 0 a value false. Each logical operation is linked to a boolean operation. In a binary image I, all pixels/voxels with value 1 belong to the set A, and all 0-value pixels to the complement set of A or the background.
When a logical operation is applied to a grayscale image, the logical operations for binary images are applied to each bit plane. Let us consider the two images
Suppose that for pixel (n,m), intensities
The result of this logical AND may appear rather strange and for this reason logical operations applied to grayscale images have to be handled with care.
The two main applications of logical operations on grayscale images are for masking and for combining bit planes.
To mask an image, a logical AND is performed between images I and M where every pixel with value 1 is coded with 1 (short value) and every pixel with value 0 is coded with 0 (short value). In masking a grayscale image I with a binary image M:
To combine bit planes, if two images
Let us consider the two color images
When a logical operation is applied to color image, it operates on each color channel. A color image pixel/voxel is a quadruplet of values coded on one unsigned byte each:
then we will have the following relations:
For example, let us suppose that
When performing a logical operation between an image and a fixed value:
For example, let us suppose that