CS180 Final Projects

Artem Shumay

Project 1: Lightfield camera.

Project tasks:

A) Depth refocusing.

B) Aperture adjustment.

Depth refocusing

Each image has associated coordinates with it, camera position. I took image (8, 8) from 17x17 grid as the center and shifted all other images to that center image to get a focusing effect. shift_yx = depth_factor * (image_yx - center_image_yx). Here are the results that are gotten after varying depth parameter:

Depth gifs -0.7 to 1.3(they might take a while to load):

Aperture adjustment

By selecting a radius within which we choose to average images we can simulate aperture. If sqrt(shift_yx^2) <= a then we add average the image.

Aperture gifs 0 to 50(they might take a while to load):

Summary

This project showed me how you can get great results by collecting a lot of data and operating on it..

Project 2: Pyramid-Based Texture Analysis.

Project tasks:

A) Create steerable pyramids.

B) Match histograms.

C) Generate textures similar to reference.

Introduction

This is a simple approach to construct textures, since all textures have some structure to them we try to catch that structure with steerable pyramid - a pyramid similar to laplaccian pyramid, but using several bandpass filters.

Creating steerable pyramids

To create steerable pyramids I took filters from pyrtools library

Here is tower of pisa convolved with these filters.

Here is a diagram from the paper which describes how steerable pyramid looks.

Steerable pyramid of tower of pisa.

The pyramid looks correct, however I encountered issues when collapsing it to reconstruct the image. I realised the problem was in the borders, I used the regular "same" borders of scipy after upscaling(upscaling had to be zero padded, no interpolation). So I wrote my own padding to reconstruct image with minimal errors.

Original

Here are the reconstruction results

Histogram matching

To match histograms I decided not to use CDF matching from first paper, and used the simpler sort matching from the second. I sort the pixels by value and set the k'th lowest pixels of image 1 to k'th lowest pixel of image 2, im1[idx_of_sorted_im1_pixels] = im2[idx_of_sorted_im2_pixels]. It behaves as expected and gives good results:

Generating textures

Now we can generate noise and histogram match every level of steerable pyramid, upon reconstruction we should get something similar to reference image. We iterate over histogram matching of pyramid to get better results, i.e we generate noise and WHILE NOT HAPPY: create pyramid, match pyramid to reference. Generated textures with 7 iterations, 4 filters, maximum acceptable depth of pyramid. To get colors working I had to convert to PCA color space, that decorrelated the colors.

From all the results we can see that it works relatively well, especially if you squeeze your eyes or look from far away, this means that even though we create steerable pyraimd we cant catch all the higher frequency features, low frequency features are captured, but higher frequency structure is not captured. Even when we did 360 filters it only caught low frequency features.

BELLS AND WHISTLES:Tuning hyperparameters

We could change number of filters(orientations) in our steerable pyramid, depth of the pyramid, and number of orientations.

Tuning number of iterations, 0 iterations means we dont deconstruct out noise into pyramid

Tuning pyramid depth

Tuning number of filters