Skip to content

akshayknarayan/cs194-final

Repository files navigation

CS194-26 Final Project

Akshay Narayan (cs194-ka) and Japheth Wong (cs194-fb)

University of California, Berkeley

Prof. Alexei (Alyosha) Efros

Running Final Project

Our project was partially implemented in MATLAB and partially in Python. As such, the various pieces of code will need to be executed separately.

To run the High Dynamic Range project:

  1. In MATLAB, navigate to the hdr directory.
  2. Execute:
#!matlab
>> main();

To run the Miniatures project:

  1. Navigate to the miniatures directory.
  2. Execute:
#!bash
$ python tiltshift.py

There is no code associated with the Vertigo Shot project.

High Dynamic Range

Code Layout

Our MATLAB code is laid out as follows:

  • apply_bilateral_filter.m: This is a helper function which computes the bilateral filter which we need as part of following Durand's algorithm for tone mapping.

  • apply_linear_tonemap.m: This is a helper function which computes the baseline tonemap, a basic linear tone mapping.

  • apply_reinhard_global_tonemap.m: This is a helper function which computes the global tone map which Reinhard proposed in his 2002 paper.

  • apply_tonemap.m: This is a helper function which takes the computed display luminance map and applies it to the HDR radiance map. This basically applies the tone map to the image so that it can be displayed in regular range.

  • compute_hdr_map.m: This is a helper function which follows Debevec's algorithm for computing the HDR radiance map.

  • compute_luminance_map.m: This is a helper function which recovers the luminance map from the computed HDR radiance map. This is basically a linear combination of the red, green, and blue channels, following the sRGB equation.

  • compute_weights.m: This is a helper function which computes the weights to use in Debevec's algorithm.

  • create_hdr_image.m: This is a function which wraps all the logic for recovering an HDR image from a sequence of photos. This returns a few results, based on different tone maps, to the caller.

  • gsolve.m: This is a function provided in Debevec's paper to solve for g, used to recover the HDR radiance.

  • main.m: This is the main function which is used to execute the project under default settings. This also displays and writes the final results.

  • read_images.m: This is a helper function which reads in the images and exposure times for all images in a directory.

  • sample_rgb_images.m: This is a helper function which constructs the Z matrix of samples to use. This is necessary because a full-size image has way too many pixels; here, we choose pixels to sample and use in our algorithm.

References

Miniatures

There is one source file for the Fake Miniatures project, tiltshift.py. There are a number of functions:

  • saturate() increases the saturation of an image.

  • get_point() collects an input point to determine the focus line.

  • applyProgressiveGaussian() recursively applies a gaussian along the parts of the image split among the focus line

  • minify() is a wrapper around applyProgressiveGaussian() that makes it more intuitive to use.

  • The other code in the file exists to call the functions above.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published