HW2

Due on Mar 4 (30 points)

  1. (10 points) Please use two photos of your own (please don't use stock photos) to create a composting image with one side from one image and another side from another image. Please decompose your images into a Laplacian pyramids with 5 levels (Note that the width and height of your images need to be a product of \(2^5=32\). You should resize them otherwise).

    1. Extra credit (5 points). Create a trackbar to vary the number of levels of decomposition as shown in class using the cvui package.

  2. (10 points) Please use the same photos as in Q2 to create a hybrid image (see this). Basically you just need to add a low-pass filtered image of one photo with a high-pass filtered image of another one. The simplest approach is probably approximating a low-pass filter with a Gaussian filter and a complementary high-pass filter with (\(1-\)“Gaussian filter”). That is, we can obtain a high-pass filtered image by subtracting the original image by a low-pass filtered image. Of course, you may also achieve something similar by playing with the fourier transformed images or discrete cosine transformed (DCT) images also.

    1. Extra credit (5 points). Add a trackbar to vary a parameter of the low-pass filter

    2. Extra credit (5 points). Add a trackbar to vary a parameter of the high-pass filter

    3. Extra credit (5 points). Add a trackbar to vary the relative weight of the two images N.B. Feel free to add more trackbars to help adjust the perceptual quality of your outcome.

  3. (10 points) Let \((x,y,1)^\top\) be the homogenous coordinates of an input image. Write down matrices \(M\) such that the output image \(M (x,y,1)^\top\) is

    1. A shift of the input image to the left by 10 units.

    2. A shift of the input image up by 10 units.

    3. A rotated image of the input image by \(30^o\)

    4. A scaled image of the input image by 2 times (in both width and height)

    5. A mirror image of the original

For all the above questions, please submit a pdf containing

  • the source code

  • the data (photos) you used (if applicable)

  • a screenshot of the output result

Please upload your solution to Canvas before the due date. Please note that we have a strict 5% per late-day penalty as listed on the course website