image = | bitwiseXOrImgImg (inIntImg1,inIntImg2) |
Bitwise exclusive or operation on 2 input images
On output image values are given by:
(with corresponding to the Bitwise xor operator)
Input and output images must have same size and buffer type. Buffers must be of type integer
A Bitwise xor operator applied to 2 integers performs the logical exclusive or operation on each pair of corresponding bits of the binary representation of these 2 integers. As shown in the truth table below, the result in each position is 1 if one and ONLY one bit among the 2 bits is 1; otherwise, the result is 0.
Input bit #1 | Input bit #2 | Output bit : |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
For instance, if we compute the result of a Bitwise xor on the two integers 5 and 3, we obtain;
0101 (decimal 5) ^ 0011 (decimal 3) = 0110 (decimal 6)
Here is an example of a Bitwise exlusive or operation applied to two 2D binary images (black pixels have value 0, white pixels have value 1):