CS 432 Project 1: Blue-Screen Compositing *
In this project you are going to experiment with the blue-screen
technique for creating a composite image from separate foreground and
background images.
I have provided red, green and blue images of 5 different fruits. Four of
these images were taken against a blue background (the fifth was imaged
against a red background). To create a mask image from an object imaged against
a blue background, the "blueness," i.e. B/(R + G + B), is a good
function to threshold. A simple algebraic function of the foreground image,
background image and mask image will yield the desired composite image.
You are welcome to use any background image you can find on the web.
Several that I happened to find are provided for your convenience but
you should not feel restricted to these. You can use xv to convert
a color image you find on the web to a grey-level .pgm image.
This project can be done in Cantata with approximately 20 glyphs. The
glyphs I found useful are: Convert Type, Normalize, Add, Divide,
Multiply, "==", Shrink, Histogram, Display 2D Plot, Thresh Below,
Constant, Inset, and Edit Image.
Foreground Red, Green and Blue Images
- Apple ( R ,
G ,
B )
- Avocado ( R ,
G ,
B )
- Orange ( R ,
G ,
B )
- Pear ( R ,
G ,
B )
- Watermelon ( R ,
G ,
B ) **
Background Intensity Images
- Europa ( I )
- Ganymede ( I )
- Io ( I )
- Mars ( I )
Hints
- Convert the data type of all input images to DOUBLE.
- You can reduce the size of the fruit image using Shrink.
- The value of blueness is always between 0 and 1.
- You can use Histogram and Display 2D Plot
to select a blueness threshold.
- You can use Inset and Constant
to pad the mask image so that it matches
the size of the background image.
- You can use "==" to complement a mask image.
- The best way to get postcript output is to use xv.
- You can run xv inside Cantata by doing the following:
1) Use Normalize to convert the image to UNSIGNED BYTE
and normalize the grey values to the range, 0-255;
2) Use Supported Formats to convert the image to .pnm;
3) Connect the output of Supported Formats to the input of
Command Icon; 4) Open Command Icon and disable
the stdout option; 5) Type "xv -" in the Command field;
6) Close Command Icon; and 7) Change the name of
Command Icon to xv (optional).
- Start early!
What It Should Look Like
An avocado in orbit around Europa.
To see something much cooler, check out James Corey's excellent
project by clicking here.
What You Should Hand In
- A screen dump showing your Cantata workspace. ***
- A screen dump of the blueness (or redness) histogram.
- Hardcopy of the background image.
- Hardcopy of the mask image (or its complement).
- Hardcopy of the final composite image.
When You Should Hand It In
The above five items should be handed in at the beginning of
class on Mon. Feb. 14, 2000.
Of Possible Interest
* This webpage is located at http://cs.unm.edu/~williams/cs432/project1s00.html
** The watermelon was imaged against a red background. There is no
reason the background has to be blue to use the blue-screen technique!
*** The grab function of xv is ideal for this purpose. Simply select
grab from the main xv window and follow the displayed
instructions. Then save the grabbed image as a postscript file and print it
on your favorite postscript printer.