TAMS / Java / Hades / applets: contents | previous | next | ||||
Hades Applets contents visual index introduction std_logic_1164 gatelevel circuits delay models flipflops adders and arithm... counters LFSR and selftest memories programmable logic state-machine editor misc. demos I/O and displays DCF-77 clock relays (switch-le... CMOS circuits (sw... RTLIB logic RTLIB registers Prima processor D*CORE MicroJava Pic16 cosimulation Mips R3000 cosimu... Intel MCS4 (i4004) image processing ... color channels JPEG compres... Sobel filter Gauss filter resize rotate chessboard gamma correc... saturation chroma-keying chroma-keying purple fringing red-eye [Sch04] Codeumsetzer [Sch04] Addierer [Sch04] Flipflops [Sch04] Schaltwerke [Sch04] RALU, Min... [Fer05] State-Mac... [Fer05] PIC16F84/... [Fer05] Miscellan... [Fer05] Femtojava FreeTTS | Chroma-keying (AND-OR)
Circuit Description
A demonstration of chroma-keying,
often used in television shows and newscasts
to present a live person in front of a completely different background.
The basic idea is to photograph (or film) the person (or object)
in front of a single-color background.
Usually, bright blue or green backgrounds are used,
because these are easy to distinguish from skin and hair colors.
An exact lightning of the background is essential, to allow the
later processing steps to safely detect the background color.
The algorithm works as follows. The input image is compared with an image of the background (bluescreen) color, and a mask image (white/black) is contructed from this. The positive mask has white for all blue pixels, while the inverted negative mask has white for all 'person' pixels. An AND-operation of the positive mask and the background mask leaves background pixels for all originally bluescreen pixels, while the corresponding AND-operation of the negative mask and the original input image leaves only the 'person' pixels. Just click on the corresponding image viewer components in the schematics to view those intermediate images. A final OR-operation is then used to merge the intermediate image into the single combined output image. The following three images show the original input image (girl in front of bluescreen, image provided courtesy of chroma-key), the background image, and the resulting combined output image:
As you can see, the algorithm as implemented here depends critically on an absolutely exact lightning of the background, because the test for background-or-not is made on the exact pixel value. Even a very small difference will result in the equality test failing, and the corresponding pixels will be taken from the bluescreen instead of the background image. See the next applet for an improved algorithm, that uses a range-based comparison and a smoothed-out transition between foreground and background.
| |||
Print version | Run this demo in the Hades editor (via Java WebStart) | ||||
Usage | FAQ | About | License | Feedback | Tutorial (PDF) | Referenzkarte (PDF, in German) | ||||
Impressum | http://tams.informatik.uni-hamburg.de/applets/hades/webdemos/00-intro/02-imageprocessing/chroma.html |