Keywords: front-page

# Image Overlaying II

[Laboratory]

The problem here is to overlay a binary annotation image over a grey-level image. In most of the cases, the Maximum or Minimum operators works well, see further examples at the end of this page. But there are cases where a simple Maximum or Minimum is not appropriate:

a)Image A; b)Image B
a) | b)

MAX(A,B)

Using the maximum of both will not display the number 16 since both use pixel level 255.

A XOR B

Using the bitwise Exclusive-Or operation will not display the number 8 since both use pixel level 128 (7FH XOR FF = 80H).

We need to create a Gating operator, i.e.

C = (A + 128) mod 256

The Gating operator combines A and B using C as a selector:

If (B) then C else A

- Lab: Image Overlaying II