Summary: This module provides example code for displaying captured IIDC (Instrumentation and Industrial Digital Camera) video in Linux via the camwire, licdc1394, and SDL (Simple DirectMedia Layer) libraries. The reader is directed to modify the example to apply simple video effects and display the results. A Unibrain Fire-i RAW Color Digital OEM Board Camera is used, but the code should apply to similar IIDC cameras.
w_drive subdirectory.cd w_drivetar -xvzf projectlab_linuxvideo.tar.gz. Typing a few letters of the filename followed by the Tab key will automatically fill in the file name.cd projectlab_linuxvideo./makescript. Open this file in a text editor to see what commands are executed../videoexampleEsc key to exit the application, or type Ctrl-C at the terminal.
videoexample.c contains comments and code
illustrating how the video is transferred and displayed. Some additional
comments on how waveforms are plotted are contained in screengraphics.h. The keyboard, mouse, and display are handled by the SDL library; documentation can be found
here.
cp videoexample.c myprojectlab.c ; cp makescript mymakescript. Modify mymakescript to compile myprojectlab instead of videoexample. Modify the
Bayer downsampling code to use two green input pixels, one red input pixel, and one blue input pixel to compute each pixel in the color output image. Currently, only one green pixel is used. In other words, each non-overlapping, 2x2 square of single-color pixels in the input image will map to one color pixel in the output image. Can you think of and implement a method that more efficiently indexes (no multiplications, few additions) the raw-input and downsampled-output images?
myprojectlab.c so that it displays three different sets of processed video, accessible via the 1-3 keys, with 1 being the default. Make the contents of each screen as follows:
g key, toggle between displaying the channels as shades of gray or the channel colors. Which channel best approximates a grayscale version of the image?
a key, toggle between displaying the channels in their default ranges and auto-contrasting the channels (with a single offset and single scale factor per quadrant image) so that the maximum RGB-color component of each quadrant image is 255 and the minimum 0. Which channel contains the grayscale image?