<< Chapter < Page | Chapter >> Page > |
w_drive
subdirectory.cd w_drive
tar -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../videoexample
Video from the camera should now be duplicated in the four quadrants of the screen, as well as some text, a line drawing of a moving sine wave, and a colored box. Press the
Esc
key to exit the application, or type
Ctrl-C
at the terminal.
The file
videoexample.c
contains comments and code
illustrating how the video is transferred and displayed. Some additionalcomments 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 .
Make a copy of the example application:
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?
Now modify
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?Make your code as modular as possible so that it is easy to follow and debug; create functions, inline functions, and/or macros for operations that will be repeatedly performed, and group similar functions/macros into separate files.
Notification Switch
Would you like to follow the 'Digital signal processing laboratory (ece 420 55x)' conversation and receive update notifications?