Image Representation
Objective
The objective of the Image Representation lab is:
- to examine the difference of subsampling with and without aliasing,
- to implement convolution with basic kernels (e.g. a Gaussian kernel, a box filter, and a gradient kernel), and
- to build Gaussian and Laplacian image pyramids.
[ADVANCED]
- to build a steerable pyramid (requires special kernels), and
- to modify the code such that it works with a live video, e.g. camera.
Software
- To access the necessary files for this lab, see directory
/eecs/home/wildes/prism/4422/Lab3_ImageRepresentation
- To compile
sampleOpenCV.c
on CentOS,
- Link the library location in the binary
% setenv LD_RUN_PATH /cs/local/lib64
- Compile the
sampleOpenCV.c
% gcc `pkg-config --cflags opencv` `pkg-config --libs opencv` sampleOpenCV.c
- To compile sampleOpenCV.c on Ubuntu,
% gcc `pkg-config opencv --cflags` sampleOpenCV.c `pkg-config opencv --libs`
Task
- Currently, when
./a.out image
is executed,
- 'ESC'-- exits the program
- 'i' -- inverts the intensities of the current image
- 'o' -- knocks out every other pixel in the original image
- 'z' -- blurs the image by applying a 3x3 filter at every pixel of the image
- Complete
sampleOpenCV.c
, such that
- 'h' -- displays subsampled+aliased and smoothed+subsampled image with their FFTs
- 'k' -- computes the convolution with the current kernel and the FFT of the resulting image is shown as well.
The following keys must be pressed every time the kernel is changed.
- '0' -- sets the current kernel to a 2D 1-4-6-4-1 Gaussian kernel
- '1' -- sets the current kernel to a 5x5 box filter
- '2' -- sets the current kernel to a simple horizontal gradient kernel
- '3' -- sets the current kernel to a simple vertical gradient kernel
- '4' -- sets the current kernel to a 1D horizontal 1-4-6-4-1 Gaussian kernel
- 'g' -- displays the Gaussian pyramid
- 'l' -- displays the Laplacian pyramid
[ADVANCED]
- 'o' -- oriented filtering of the pyramidal image.
Every key press rotates the filter orientation by 22.5 degrees and the corresponding FFTs for each level are shown as well.