CS194-26: Intro to Computer Vision and Computational Photography, Fall 2021

Project 1: Image Manipulation and Computational Photography

INSTRUCTOR: Alexei (Alyosha) Efros, Angjoo Kanazawa

Jingqi Huang, CS194-26



Overview

We divides the picture into three parts, r, g, b, and align three parts to output a color image as output.


For each image, divide it into three height equal part and then align by calculating the ssd. Using image pyramid to reduce runtime for high resolution versions. Ignore surrounding edges to decrease the impact of black edges.

For every input, if the width height sum is less than or equal to 1000, I exhaustively loop through a square of 50*50 with the out most 1/20 edge is cut off, then calculate the ssd and find a shift with smallest ssd.

If the width and height sum is greater than 1000, use image pyramid to recursively rescale the image to 1/2 of previous size until the width height sum is less than or equal to 1000. For image in image pyramid except for the coarest one, loop through a square of 10*10 around the best shift find from previous layer.

Overall runtime is reduced to around 30 seconds

See result picture as following:









g shifts: 2(w) 5(h), r shifts: 3(w), 12(h)
g shifts: 2(w) -3(h), r shifts: 2(w), 3(h)
g shifts: 2(w) 3(h), r shifts: 3(w), 6(h)
g shifts: 3(w) 25(h), r shifts: -5(w), 58(h)
g shifts: 16(w) 60(h), r shifts: 14(w), 124(h)
g shifts: 9(w) 82(h), r shifts: 11(w), 177(h)
g shifts: 13(w) 54(h), r shifts: 10(w), 112(h)
g shifts: 26(w) 78(h), r shifts: 33(w), 175(h)
g shifts: 26(w) 51(h), r shifts: 36(w), 108(h)
g shifts: 17(w) 41(h), r shifts: 23(w), 89(h)
g shifts: 3(w) 42(h), r shifts: 31(w), 87(h)
g shifts: -1(w) 53(h), r shifts: -13(w), 102(h)
g shifts: 4(w) 55(h), r shifts: 7(w), 111(h)
g shifts: 24(w) 49(h), r shifts: 157(w), 193(h)
g shifts: -15(w) 58(h), r shifts: -59(w), 131(h)
g shifts: 21(w) 56(h), r shifts: 40(w), 122(h)