Coder Social home page Coder Social logo

cs194-final's Introduction

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.

cs194-final's People

Contributors

akshayknarayan avatar japhethwong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cs194-final's Issues

weights in compute_weights.m

Hi Narayan,
Thanks a lot for the code. It helped me to get good understanding of HDR.

There is an issue in compute_weights.m
at line 12
weights = min(weights, 256 - weights);
this calculates weights as [1,2,3 .....128,127,126.....0]

it needs to be corrected to
weights = min(weights, 257 - weights);
so that the weights become symmetric as [1,2,3 .....128,128,127.....1]

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.