Assignment 1
Gaussian pyramids and gradient computation
In this assignment you need to generate the Gaussian pyramid of an image and compute the image gradient at each level of the pyramid. The program should allow the user to move between the different levels and display the image gradient magnitude/orientation when requested. The program should satisfy the following specifications:
- The image to be processed by the program should be either read from a file or captured directly from a camera. If a file name is specified in the command line, the image should be read from it. Otherwise the program should attempt to capture an image from a camera. When capturing an image from a camera, a new image should be captured at each iteration.
- The read image should be converted to grayscale and displayed on the screen. All subsequent processing should be performed on the grayscale image.
- The Gaussian pyramid should be computed and stored in memory. A track-bar should be used to move between the different levels of the pyramid. The maximal number of levels in the pyramid is 4.
- Special keys on the keyboard should be used to modify the displayed image as follows:
- '1' - Show the original image in color (this applies only to the highest scale - you do not need to maintain a pyramid of the color image).
- '2' - Show the gray scale image (in the selected scale).
- '3' - Show the magnitude of the image gradients (in the selected scale) normalized to the range [0..255].
- '4' - Select of the pixels in the image having the largest magnitude, and show the gradient vectors in them using line segments overlay. The percentage should be controlled using a track-bar. Note that you need to select the line length of the vectors so that they are visible but are not excessively large.
- 's' - Save the current image into a file (named 'out.jpg').
- 'h' - Display a short description of the program, its command line arguments, and the keys it supports.