Assignment 0: C++ Refresher
COMPUTATIONAL ASPECTS OF DIGITAL PHOTOGRAPHY
Wojciech Jarosz wojciech.k.jarosz@dartmouth.edu
COMPUTATIONAL PHOTOGRAPHY
CS 89.15/189.5, Fall 2015
C OMPUTATIONAL A SPECTS OF C OMPUTATIONAL D IGITAL P HOTOGRAPHY P - - PowerPoint PPT Presentation
CS 89.15/189.5, Fall 2015 C OMPUTATIONAL A SPECTS OF C OMPUTATIONAL D IGITAL P HOTOGRAPHY P HOTOGRAPHY Assignment 0: C++ Refresher Wojciech Jarosz wojciech.k.jarosz@dartmouth.edu First programming assignment Programming assignment 0 available
Assignment 0: C++ Refresher
Wojciech Jarosz wojciech.k.jarosz@dartmouth.edu
CS 89.15/189.5, Fall 2015
CS 89/189: Computational Photography, Fall 2015
Programming assignment 0 available on class website
2
CS 89/189: Computational Photography, Fall 2015
More efficient than Java (compilation, memory)
Standard language for many domains where performance matters (graphics, imaging) Good experience
4 Modeled after a slide by Frédo Durand
CS 89/189: Computational Photography, Fall 2015
http://cs.brown.edu/courses/cs123/docs/ java_to_cpp.shtml http://www.cprogramming.com/java/c-and-c++-for- java-programmers.html http://www.horstmann.com/ccj2/ccjapp3.html and many more…
5 Modeled after a slide by Frédo Durand
CS 89/189: Computational Photography, Fall 2015
Can be encoded as 3D arrays
Formally:
Other color spaces possible Values often encoded as 8- or 16-bit integers ([0..255] or [0..65535])
7 Modeled after a slide by Frédo Durand
CS 89/189: Computational Photography, Fall 2015
C++ vector
Array3D (array3d.h)
array
8 Modeled after a slide by Frédo Durand
vectors only have one 1D index turn 2D index into 1D through strides
CS 89/189: Computational Photography, Fall 2015
9
2D array
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1D vector encoding
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Modeled after a slide by Frédo Durand
vectors only have one 1D index likewise for 3D where z is the color channel
3D array
18 19 20 21 22 23 24 25 26 9 10 11 12 13 14 15 16 17
CS 89/189: Computational Photography, Fall 2015
10
1 2 3 4 5 6 7 8
1D vector encoding
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Modeled after a slide by Frédo Durand
CS 89/189: Computational Photography, Fall 2015
Inherits from Array3D<float> Stores a vector of pixel values
size & number of dimensions
access data using operator(…), e.g.: image(x,y,z)
11
CS 89/189: Computational Photography, Fall 2015
We’ll use PNG
We’ll talk about how JPEG and other formats work later
12
CS 89/189: Computational Photography, Fall 2015
Just a warm up familiarize yourself with C++, the FloatImage class compile change brightness & contrast of an image
13
CS 89/189: Computational Photography, Fall 2015
History of photographic technology
14
CS 89/189: Computational Photography, Fall 2015
Frédo Durand
15