Logo
iball
 Home
 About
 Products
 Applications
 Employment
 Contact
 Links

Comparing Images with Overlays
(continued)

Bitmap transparency involves taking a bitmap and making one of the colors in the bitmap transparent so that when the bitmap is blt'd to the screen, the destination can be seen through the bitmap's transparent color. There are numerous ways to build a Mask from a color bitmap and combine it with the destination using the ROP functions such as the ones mentioned here.
If the source bitmap is a device-independent bitmap (DIB) format, the whole masking operation can be greatly simplified by using one DIB as both the source and the mask by simply thresholding the source and manipulating the color table.
The following code uses the StretchDIBits function to create an XOR (inverted) source merged with the destination.

StretchDIBits(hdcDest, x, y, dx, dy, (void *)buf,info,DIB_RGB_COLORS, SRCINVERT)

The images being stored and the live images referred to in this application are Grayscale (monochrome) images. The VGA display needs to be set to 16 or 24 bit color to display a continuous grayscale image with reasonable fidelity. To create an overlay image the stored grayscale image is compared to a threshold and the resultant binary image is used to generate a single color overlay thereby generating a pseudocolor image on the monochrome image. The single color overlay can be red, green or blue. We use red as a default as it yields very good contrast results. The red overlay then consists of an array of pixels that are either red or black. For a 24 bit color display they are either FF,00,00 or 00,00,00. The ROP XOR (exclusive OR) function is then performed between the red overlay and the live grayscale image. This allows the live image green and blue values to be unchanged. The red values of the live image are either inverted where the red overlay is red (FF,00,00) or unchanged where the red overlay is black (00,00,00). The overlay can also be optionally inverted (reverse red and black) to optimize the image for different circumstances.

Figure 1

Overlay

The resulting image gives green and red highlights to areas that have changed from the stored standard image to the live image under test. The overlay template is created from a binary threshold output from the stored standard image and the threshold can be adjusted to optimize the resulting overlay display. Other colors can be selected for the overlay for different results.

Page 1 2 3 4 5 6

Site designed by:

NAMCAniSmLogo
[Home] [About] [Products] [Applications] [Employment] [Contact] [Links]

Copyright © 1999 ORS Automation, Inc. All rights reserved.
Information in this document is subject to change without notice.
Other products and companies referred to herein are trademarks or registered trademarks of their respective companies or mark holders.