<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-16203594</id><updated>2023-06-20T09:40:57.833-04:00</updated><title type='text'>An Idiot, a digital camera, and a PC</title><subtitle type='html'>My name is Seung Chan Lim, a clueless noob trying to make sense of the subject of computational photography by re-teaching the material learned in class....</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://15463.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default?alt=atom'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>10</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-16203594.post-112821831006506080</id><published>2005-10-10T21:48:00.000-04:00</published><updated>2005-10-15T13:53:01.250-04:00</updated><title type='text'>Homogeneous coordinates: more warping</title><content type='html'>&lt;p&gt;
Now we all had fun with those 2×2 matrices in the previous entry, right? ;) (boo....) Before you think to yourself that that&#39;s the end of matrices, lemme warn you that this entry will involve &lt;em&gt;even more&lt;/em&gt;. *SIGH* But, I promise you I won&#39;t turn this into a math blog!! =) In all seriousness,  I assure you it&#39;s nothing too complicated.
&lt;/p&gt;
&lt;p&gt;
So! As simple and nice as those 2×2 matrices were, the math geeks were not satisfied. Why not, you may ask. Well, the problem is 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

that although we can do all the mirroring, shearing, and rotating till the sun goes down, we &lt;em&gt;cannot&lt;/em&gt;, for the love of God, &lt;em&gt;move&lt;/em&gt; the damn image from one position to another. I mean... We defined image warping as a general notion of moving pixels around, yet we can&#39;t do simple horizontal/vertical sliding around of images?! That&#39;s just wrong, no?? Well, so there&#39;s a trick to doing this, and it&#39;s called &lt;strong&gt;homoegeneous coordinates&lt;/strong&gt;.
&lt;/p&gt;

&lt;p&gt;
Although I won&#39;t go into details on what exactly &lt;strong&gt;homogeneous coordinates&lt;/strong&gt; are, or in what other context they&#39;re used, I&#39;ll at least say that as far as we&#39;re concerned, it&#39;s just a kludge that will allow us to represent image translation (sliding it horizontally and vertically) in matrix form. &lt;/p&gt;

&lt;p&gt;In real simple terms, what we&#39;re going to do is add the number &quot;1&quot; as a new entry into our coordinate space like so:
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x
 y
 1]
&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;
Now, what that does is it forces us to turn our transformation matrices into 3×3 matrices, just to be able to get the matrices to multiply together. So if we had a 3×3 matrix like this one:
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;  =  [1 0 t&lt;sub&gt;x&lt;/sub&gt;  [x
 y&#39;  =   0 1 t&lt;sub&gt;y&lt;/sub&gt;   y
 1]  =   0 0 1 ]  1]
&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;
and solved the equation, like so:
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
x&#39; = 1 × x + 0 × y + t&lt;sub&gt;x&lt;/sub&gt; * 1
y&#39; = 0 × x + 1 × y + t&lt;sub&gt;y&lt;/sub&gt; * 1
1 = 0 × x + 0 × y + 1 * 1
&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;
You&#39;ll end up with:
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
x&#39; = x + t&lt;sub&gt;x&lt;/sub&gt;
y&#39; = y + t&lt;sub&gt;y&lt;/sub&gt;
&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;
Boo yah! You&#39;ve got yourself a translation matrix that lets you add arbitrary scalar values to the x and y coordinates. =)
&lt;/p&gt;
&lt;p&gt;
For a more in-depth intro to homogeneous coordinates, check &lt;a href=&quot;http://www.unchainedgeometry.com/jbloom/pdf/homog-coords.pdf&quot;&gt;this paper titled introduction to homogeneous coordinates&lt;/a&gt;. Oh, and when they mention some mumbo jumbo about a &lt;a href=&quot;http://mathworld.wolfram.com/EuclideanPlane.html&quot;&gt;Euclidean plane&lt;/a&gt;, those &lt;del&gt;pedantic fools&lt;/del&gt; &lt;ins&gt;math scholars&lt;/ins&gt; are basically referring to a plane that&#39;s 2 dimensional and consists only of &lt;a href=&quot;http://www.math.vanderbilt.edu/~schectex/courses/thereals/&quot;&gt;real numbers&lt;/a&gt;.
&lt;/p&gt;&lt;p&gt;
So now you can take all the 2×2 matrices we&#39;ve shown in the previous entry, and turn them into 3×3 matrices that use homogeneous coordinates
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Translate&lt;/strong&gt;
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;  =  [1 0 t&lt;sub&gt;x&lt;/sub&gt;  [x
 y&#39;  =   0 1 t&lt;sub&gt;y&lt;/sub&gt;   y
 1]  =   0 0 1 ]  1]
&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;&lt;strong&gt;Scale&lt;/strong&gt;&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;  =  [s&lt;sub&gt;x&lt;/sub&gt; 0  0  [x
 y&#39;  =   0  s&lt;sub&gt;y&lt;/sub&gt;  0   y
 1]  =   0  0   1 ]  1]
&lt;/pre&gt;&lt;/code&gt;


&lt;p&gt;&lt;strong&gt;Rotate&lt;/strong&gt;&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;  =  [cosθ -sinθ 0  [x
 y&#39;  =   sinθ cosθ  0   y
 1]  =   0    0     1 ] 1]
&lt;/pre&gt;&lt;/code&gt;


&lt;p&gt;&lt;strong&gt;Shear&lt;/strong&gt;&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;  =  [1  sh&lt;sub&gt;x&lt;/sub&gt; 0  [x
 y&#39;  =   sh&lt;sub&gt;y&lt;/sub&gt; 1 0   y
 1]  =   0    0 1 ]  1]
&lt;/pre&gt;&lt;/code&gt;

&lt;p&gt;
Alright, now before we dive further into our newly found interest in 3×3 matrices, let&#39;s first make some notes about the propertis of the &lt;a href=&quot;http://mathworld.wolfram.com/LinearTransformation.html&quot;&gt;linear transformations&lt;/a&gt; discussed in the previous entry.
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;orgin maps to orgin, meaning that th pixel found at the origin (0,0) in the original image can be found at the origin (0,) in the transformed image&lt;/li&gt;
&lt;li&gt;lines map to lines&lt;/li&gt;
&lt;li&gt;parallel lines remain parallel&lt;/li&gt;
&lt;li&gt;ratios are preserved&lt;/li&gt;
&lt;li&gt;closed under composition - meaning you can combine them together to yield a single 2x2 transformation matrix&lt;/li&gt;
&lt;/ul&gt;
&lt;/code&gt;
&lt;p&gt;
With that said, let&#39;s look at transformations that involve both linear and non-linear transformations. Let&#39;s take &lt;strong&gt;affine&lt;/strong&gt;, for example.
&lt;/p&gt;

&lt;strong&gt;Affine&lt;/strong&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;  =  [a b c  [x
 y&#39;  =   d e f   y
 w]  =   0 0 1]  w]&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;
This one is a combo of translation and transformation and it violates one of the properties of a linear transformation, which is that its
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
origin does not necessarily map to origin
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Next we have &lt;strong&gt;projective transformation&lt;/strong&gt; which takes the following form:
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Projective&lt;/strong&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;  =  [a b c  [x
 y&#39;  =   d e f   y
 w]  =   g h i]  w]
&lt;/pre&gt;&lt;/code&gt;&lt;p&gt;&lt;/p&gt;

&lt;p&gt;
it&#39;s basically affine plus projective warps, and it violates 3 of the properties found in a linear transformation since
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
origin doesn&#39;t necessarily map to origin
&lt;/li&gt;
&lt;li&gt;
paralle lines do not ncessarily remain parallel
&lt;/li&gt;
&lt;li&gt;
ratios are not preserved
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
One thing to note is that since these matrices are closed under composition, we can multiply them together to get a single matrix that will carry out the entire series
of transformations. Do keep in mind, however, that order is important.
&lt;/p&gt;
&lt;p&gt;
So, armed with any of the above transformation matrices, we can iterate through all the pixels on a given image and find out where it would end up in the transformed
image. This is known as &lt;strong&gt;forward warping&lt;/strong&gt;. Watch out, though, cuz it can get interesting when the x, y values come out to be a fraction (i.e. in between two pixels). In this case we can use a technique called &lt;strong&gt;splatting&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
Then there is also &lt;strong&gt;inverse warping&lt;/strong&gt; where you iterate through
all the pixels on the &lt;em&gt;transformed image&lt;/em&gt;
and multiply it by the &lt;em&gt;inverse&lt;/em&gt; of the transformation matrix
to get the pixel that

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

it would have &lt;em&gt;originated 
from&lt;/em&gt; to find the brightness value to use. Of course, we 
can, again, run into cases where the originating pixel
lands onn a non integer x, y value in which case we can
use various interpolation techniques such as &lt;strong&gt;nearest neighbor&lt;/strong&gt;, &lt;strong&gt;bilinear&lt;/strong&gt;, &lt;strong&gt;bicubic&lt;/strong&gt;, &lt;strong&gt;gaussian&lt;/strong&gt;, etc... to pick a nearby pixel.

&lt;p&gt;
In general, inverse warping is more commonly used given that it makes sure
that all pixels on the transformed image is covered. In a &lt;strong&gt;foward
warp&lt;/strong&gt;, you may run into cases where not all pixesl on the transformed
image is accounted for. That means that you might end up with
holes in your transformed image due to the fact that no brightness value
has been picked for that pixel.&lt;strong&gt; Inverse warping&lt;/strong&gt; isn&#39;t perfect, either.
The problem in this case is that you have to assume that
the inverse of the transformation matrix &lt;em&gt;can&lt;/em&gt; be found. Unfortunately, this
is not always the case. &lt;/p&gt;&lt;p&gt; &lt;/p&gt;&lt;p&gt;Alright, so tune in next time for an interesting adventure into the world of image morphing!

&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://15463.blogspot.com/feeds/112821831006506080/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/16203594/112821831006506080' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112821831006506080'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112821831006506080'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/2005/10/homogeneous-coordinates-more-warping.html' title='Homogeneous coordinates: more warping'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16203594.post-112726350721955813</id><published>2005-10-01T20:43:00.000-04:00</published><updated>2005-10-13T03:24:02.003-04:00</updated><title type='text'>Entering Warp Zone!</title><content type='html'>&lt;p&gt;
In the previous entry we looked at &lt;strong&gt;image processing&lt;/strong&gt;, which involved changing the brightness values of the pixels. This time let&#39;s look at &lt;strong&gt;image warping&lt;/strong&gt;, which entails &lt;em&gt;moving&lt;/em&gt; a pixel from one position to another.
&lt;/p&gt;
&lt;p&gt;
Simply put, warping is the process taken to warp (DUH!) a pixel from its original x, y position to a new x, y position. In math talk, this is referred to as changing the &lt;strong&gt;domain&lt;/strong&gt; of an image. The &lt;strong&gt;domain&lt;/strong&gt; &lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
basically denotes the range in which the values of x and y for the pixels inside an image reside within. For example, let&#39;s say the domain in which the pixels were laid out in the original image ranged from 0 to 10 in the x axis and 0 to 20 in the y. If we were to move this image by +5 pixels in the x-axis and +10 pixels in the y, then x in the warped image will end up spanning 5 to 15 and y, 10 to 20.
&lt;/p&gt;
&lt;p&gt;
While we&#39;re in math land, let&#39;s venture in a lil further and visit some linear algebra concepts. Don&#39;t worry, it&#39;s nothing terribly complicated. =) it&#39;s just that warping can be represented quite nicely using a simple series of matrix operations since we&#39;re dealing with numbers in a discrete domain (remember that digital images are brightness values sampled at discrete intervals in space). I&#39;ll tell ya, math geeks definitely get off on the elegance of simple matrix operations. ;)
&lt;/p&gt;
&lt;p&gt;
There are a few different types of image warps. Most common ones include translation, rotation, aspect, affine, and perspective. These are called &lt;strong&gt;parametric&lt;/strong&gt; or &lt;strong&gt;global warping&lt;/strong&gt;. I&#39;ll define that term in just a second, but first let&#39;s talk matrix.
&lt;/p&gt;
&lt;p&gt;
The act of warping an image is also referred to as a &lt;strong&gt;transformation&lt;/strong&gt;, and we call the function that takes an image to produce a new image, the &lt;strong&gt;transformation function&lt;/strong&gt;. Given that, we can now represent this relationship as follows.
&lt;/p&gt;
&lt;pre&gt;
&lt;code&gt;
p&#39; = T(p)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
where &lt;code&gt;p&lt;/code&gt; represents points on the original image and &lt;code&gt;p&#39;&lt;/code&gt; represents points on the transformed image.
&lt;/p&gt;
&lt;p&gt;
If we were to dig one level deeper and break out the point into the &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; components and depict it as a 2 x 1 matrix, we&#39;d get the following:
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;[x

 y]&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;
We can then define the previous relationship again as a matrix equation:
&lt;/p&gt;
&lt;code&gt;
&lt;pre&gt;[x&#39;       [x
     =  M
 y&#39;]       y]
&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;
where &lt;code&gt;M&lt;/code&gt; is the matrix that defines the &lt;strong&gt;transformation function&lt;/strong&gt; &lt;code&gt;T&lt;/code&gt;.
&lt;/p&gt;
&lt;p&gt;
What this equation means is that for each and every pixel at &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; that resides within the original image &lt;code&gt;p&lt;/code&gt;, we&#39;ll multiply it by the transformation matrix &lt;code&gt;M&lt;/code&gt; to get new values of &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt;, &lt;code&gt;x&#39;&lt;/code&gt; and &lt;code&gt;y&#39;&lt;/code&gt;, that are on the new image. The fact that the transformation gets applied uniformly across all pixels is why this type of warping is called &lt;strong&gt;parametric/global warping&lt;/strong&gt;
&lt;/p&gt;
&lt;p&gt;
You&#39;re dying for some more matrices, right?! Soooo... Let&#39;s start with scaling. Scaling is an operation that resizes an image to make it bigger or smaller. What this really means is that the &lt;code&gt;x&lt;/code&gt; and &lt;code&gt;y&lt;/code&gt; components are multiplied by a scalar value so that the distance between two 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

neighboring x values and two neighboring y values are increased, ending up with an image that has an onverall dimension that is either bigger or smaller. In a &lt;strong&gt;uniform scaling&lt;/strong&gt; operation you multiply the &lt;code&gt;x&lt;/code&gt; and the &lt;code&gt;y&lt;/code&gt; component by the same scalar, and in a &lt;strong&gt;non-uniform scaling&lt;/strong&gt; operation you multiply them independently with &lt;em&gt;different&lt;/em&gt; scalars. This simple multiplication can be expressed in matrix form as follows:
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;    [a 0    [x
     =       *
 y&#39;]    0 b]    y]
&lt;/pre&gt;&lt;/code&gt;
&lt;p&gt;
where a and b are the scalars to be used to multiply x and y by respectively.
&lt;/p&gt;
&lt;p&gt;
Let&#39;s quickly refresh our memories on how we multiply matrices together. You take the first row and match it up with the first column to get
&lt;/p&gt;
&lt;code&gt;x&#39; = a × x + 0 × y&lt;/code&gt;
then you take the second row and match it up with the first column to get
&lt;p&gt;
&lt;code&gt;y&#39; = 0 × x + b × y&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
Next we have 2D Rotation which entails moving a pixel at position x and y to point x&#39;, y&#39; so that the vectors from the origin to the two points make a certain angle, say θ. I won&#39;t go into the good ol&#39; highschool trig you had painfully memorized only to quickly forget after that dreaded &lt;a href=&quot;http://www.ibo.org/ibo/index.cfm&quot;&gt;IB exam&lt;/a&gt;, but the matrix equation comes out to take the following form.
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;    [cos(θ) - sin(θ)   [x
     =
 y&#39;]    sin(θ)   cos(θ)]   y]
&lt;/pre&gt;
&lt;/code&gt;
&lt;p&gt;
Then we have 2D shear which is represnted as follows:
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;    [1  sh&lt;sub&gt;x&lt;/sub&gt; [x
     =
 y&#39;]    sh&lt;sub&gt;y&lt;/sub&gt; 1]  y]
&lt;/pre&gt;&lt;/code&gt;&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
And 2D mirroring about the Y axis
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;    [-1  0  [x
     =
 y&#39;]     0  1]  y]
&lt;/pre&gt;
&lt;/code&gt;&lt;p&gt;
and about (0, 0)
&lt;/p&gt;
&lt;code&gt;&lt;pre&gt;
[x&#39;    [-1  0 [x
     =
 y&#39;]     0 -1]  y]
&lt;/pre&gt;
&lt;/code&gt;&lt;/code&gt;
&lt;p&gt;
Well, I think that&#39;s enough matrices for you to chew on for the night. In the next entry things get more interesting as we look at some of the more combinatorial warping. ;) Stay tuned!
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://15463.blogspot.com/feeds/112726350721955813/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/16203594/112726350721955813' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112726350721955813'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112726350721955813'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/2005/10/entering-warp-zone.html' title='Entering Warp Zone!'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16203594.post-112758927639915167</id><published>2005-09-24T15:02:00.000-04:00</published><updated>2005-09-25T17:12:05.363-04:00</updated><title type='text'>Gamma correction, contrast stretching and blurring.</title><content type='html'>&lt;p&gt;
Ok, so where were we... Oh yeah, examples of image processing filters. Right. So, let&#39;s start with a somewhat obscure filter called &lt;strong&gt;gamma correction&lt;/strong&gt;. &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Gamma_correction&quot;&gt;Gamma correction&lt;/a&gt;&lt;/strong&gt; is an action taken to adjust the intensity value projected at a given pixel, so that it either becomes darker or brighter. Sounds like a pretty simple brightness control, eh? Well, it is, but with a slight twist.&lt;/p&gt;
&lt;p&gt;
If you &lt;em&gt;have&lt;/em&gt; heard of the term &lt;strong&gt;gamma correction&lt;/strong&gt;, chances are good that you would have heard it in relation to your monitor. The problem with monitors is that the light they project in correspondence to a certain brightness value, is often perceived by humans to have a &lt;em&gt;different&lt;/em&gt; brightness value. 
It&#39;s somewhat of a 
&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;


complicated interaction between &lt;a href=&quot;http://www.mic-d.com/java/digitalimaging/gamma/&quot;&gt;physics, perception, photography and video&lt;/a&gt;. To put it in simple terms, while the monitor thinks it&#39;s displaying 50% brightness at a pixel, we might look at it and think that it&#39;s only 25% bright. Luckily it turns out that this phenomenon approximately follows a well-known relationship called the &lt;a href=&quot;http://en.wikipedia.org/wiki/Power_law&quot;&gt;&lt;strong&gt;power law&lt;/strong&gt;&lt;/a&gt;. The power law equation takes the following form:&lt;/p&gt;
&lt;code&gt;
s = r&lt;sup&gt;γ&lt;/sup&gt;
&lt;/code&gt;
&lt;p&gt;You&#39;ll notice the gamma power in the equation, and this is where the term &lt;strong&gt;gamma&lt;/strong&gt; in &lt;strong&gt;gamma correction&lt;/strong&gt; comes from. Now, given this relationship, if we can figure out the value of gamma , we can find the inverse of the function that will yield the &quot;corrected&quot; intensity value for each intensity value that the monitor would normally produce. The &quot;corrected&quot; intensity value would essentially be compensating for flaws in human perception or the electronics of the monitor.
&lt;/p&gt;&lt;p&gt;
The simplest way to carry this operation out at the absence of a &lt;a href=&quot;http://vsg.cape.com/~pbaum/meter1.htm&quot;&gt;photometer&lt;/a&gt; requires projecting an image that is known to be perceived by humans to have a certain brightness, then, right next to it, we need to project what the monitor produces when it&#39;s told to project the same brightness. With both of these images present, a human being can either raise or lower the intensity of the image projected by the monitor until the two match up. Given this mapping, the inverse function can be found from the &lt;strong&gt;power law&lt;/strong&gt;. Now, the only thing left for us to figure out is to determine &lt;em&gt;how&lt;/em&gt; to project an image that we know for sure will be perceived by humans to have a certain brightness. Well, when we can&#39;t depend on the brain of the machine to figure things out, I guess we&#39;ll just have to do it the old fashioned way and let the human brain do the job. =) &lt;/p&gt;&lt;p&gt;As we have &lt;a href=&quot;http://15463.blogspot.com/2005/09/taking-advantage-of-human-eye.html&quot;&gt;discussed before&lt;/a&gt;, the human eye is not a photometer, but it is very sensitive to differences in brightness. So when we have two colors right next to each other that are different enough, the human brain notices the difference and averages them out. By taking advantage of this fact we can project a pattern of alternating 0% and 100% intensity values to yield an image of 50% brightness. This is called &lt;strong&gt;dithering&lt;/strong&gt;, and it is the technique used to produce the illusion of &lt;a href=&quot;href=&quot;&gt;gradation on a monochrome monitor&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
Ok, so on with the next filter. The next filter has a rather well-known name, and it&#39;s quite likely that you&#39;re familiar with it. The filter is called &lt;strong&gt;contrast stretching&lt;/strong&gt;. Often times, an image is acquired in such a way that the brightness values found in the image do not make full use of the available range. For example, although the camera is able to show brightness values ranging from 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

0 to 255, the image may only use values between 30 and 180. The resulting image is usually somewhat muggy and the objects may seem too blended in to the scene. &lt;strong&gt;Contrast stretching&lt;/strong&gt; allows you to take the ends of the intensity range found in the image
and stretch them out so that the lowest intensity value maps closer to 0 and the highest intensity value maps closer to 255. What this does is it allows the brightness values found in the image to be more spread out, yielding a higher range of differences or contrast among the individual brightness values. If your image happened to not take advantage of the higher end of the brightness spectrum, the filter will also make your image brighter.&lt;/p&gt;
&lt;p&gt;
The most well-known algorithm used to carry this stretch operation out is the use of &lt;a href=&quot;http://www.netnam.vn/unescocourse/computervision/22.htm&quot;&gt;histogram equalization&lt;/a&gt;. Histogram equalization entails plotting the &lt;strong&gt;normalized cumulative histogram graph&lt;/strong&gt; where the X-axis encodes the intensity values found in the original image and the Y-axis encodes the number of pixels found to have that intensity value. Once you plot &lt;a href=&quot;http://greta.cs.ioc.ee/~khoros2/one-oper/equalization/front-page.html&quot;&gt;this graph&lt;/a&gt; you&#39;&#39;re basically going to end up with a lookup table where the X-axis represents the old intensity value and the Y-axis represents the factor by which you can multiply the maximum intensity value available to get the new intensity value.
&lt;/p&gt;
&lt;p&gt;
The last filter we&#39;ll cover is called the &lt;strong&gt;mean filter&lt;/strong&gt; aka blurring filter. &lt;strong&gt;Mean filtering&lt;/strong&gt; is basically a technique used to filter out noise to smooth up a given image. What you do in &lt;strong&gt;&lt;a href=&quot;http://www.cee.hw.ac.uk/hipr/html/mean.html&quot;&gt;mean filtering&lt;/a&gt;&lt;/strong&gt; is you pick a window over which to apply the filter, and modify the value at the &lt;em&gt;center&lt;/em&gt; of that window so that it is the mean of all the surrounding values within the window. You would then repeat this process for all the pixels you&#39;d like to have smoothed out. This process is also known as &lt;strong&gt;cross-correlation filtering&lt;/strong&gt; and the formula takes on the following form:
&lt;/p&gt;
&lt;p&gt;
&lt;code&gt;
G = H (&amp;times;) F.
&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
In this equation, &lt;strong&gt;H&lt;/strong&gt; is the &quot;kernel&quot; and &lt;strong&gt;F&lt;/strong&gt; is the original image. The kernel is basically the aforementioned window with a multiplier in each of the slot that the pixel values found in the slot would be multiplied by before being summed together. You can take a look at an example of the kernel in action &lt;a href=&quot;http://www.markschulze.net/java/&quot;&gt;here&lt;/a&gt;. The sum of all multipliers in the kernel always amounts to 1. &lt;/p&gt;&lt;p&gt;In a &lt;strong&gt;mean filter&lt;/strong&gt;, the kernel contains the exact same multiplier in each of the slot. This means that all the pixels found inside a kernel are given equal weight when calculating the mean. The problem with this is that as the window gets larger, the chance of the mean becoming skewed by distant intensity values that happen to be drastically bigger or smaller than the rest. To counter this 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;


problem, we also have &lt;strong&gt;&lt;a href=&quot;http://www.cee.hw.ac.uk/hipr/html/gsmooth.html&quot;&gt;Gaussian filtering&lt;/a&gt;&lt;/strong&gt; which is another form of blurring, with the difference being that it gives different weight to different slots in the kernel. More specifically, the further away from the center of the slot, the less weight it gets when getting summed up to yield the intensity value for thecanterr pixel. This way we can have big windows for wider range of smoothing, but the resulting mean does not get messed up by that black or white pixel found at the corner or the kernel.&lt;/p&gt;

&lt;p&gt;Was that nough filter babble for ya? =) Now whenever you open up &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;amp;amp;amp;ie=UTF-8&amp;oe=UTF-8&amp;amp;c2coff=1&amp;client=pub-7738110918761047&amp;amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;amp;q=photoshop&amp;btnG=Search&amp;amp;sitesearch=&quot;&gt;Photoshop&lt;/a&gt; and click on that mighty &quot;filters&quot; menu, take some time to stop and think about how they work. Who knows? You might be the one to come up with the next coolest filter! =)
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://15463.blogspot.com/feeds/112758927639915167/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/16203594/112758927639915167' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112758927639915167'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112758927639915167'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/2005/09/gamma-correction-contrast-stretching.html' title='Gamma correction, contrast stretching and blurring.'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16203594.post-112646422261750925</id><published>2005-09-18T14:42:00.000-04:00</published><updated>2005-09-24T15:22:26.226-04:00</updated><title type='text'>Basics of Image Processing</title><content type='html'>&lt;p&gt;
Now that we&#39;re acquainted ourselves with the medium through which we can acquire digital images, let&#39;s talk about what digital images are and what we can do to them.
&lt;/p&gt;
&lt;p&gt;
So what is a digital image? Well, you can basically think of it as a 2x2 matrix or grid on which a bunch of brightness values are stored. If you remember from our &lt;a href=&quot;http://15463.blogspot.com/2005/09/taking-advantage-of-human-eye.html&quot;&gt;previous discussions&lt;/a&gt;, the slots in this matrix are called pixels, and we typically encode the brightness values as a triplet of R, G, B values. So if you were to imagine a 3D coordinate space, you&#39;ll have the x, and the y axis defining the plane on which the image lies, and the z axis will represent the brightness values at each point, where higher the z value, the brighter the pixel is.
&lt;/p&gt;
&lt;p&gt;
The real cool thing about having a discrete value matrix at hand is that we can now use simple math to apply some interesting effects to the image. The most obvious thing you can think of is taking the intensity values of an image and simply multiplying them by a factor.

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

For example, you can half the intensity values at all the pixels to get a image that is half the brightness. This is called &lt;strong&gt;image processing&lt;/strong&gt;, and the particular operation we just described is called &lt;strong&gt;&lt;a href=&quot;http://www.schorsch.com/kbase/glossary/image_filtering.html&quot;&gt;filtering&lt;/a&gt;&lt;/strong&gt;. &lt;strong&gt;Filtering&lt;/strong&gt; basically takes a pixel on an image, applies a certain mathematical function on it to yield a potentially different value and replaces the original with it. You can obivously repeat this process for all the pixels on a given image. &lt;p&gt;&lt;/p&gt;
&lt;p&gt;
There&#39;s also another type of &lt;a href=&quot;http://www.ph.tn.tudelft.nl/Courses/FIP/noframes/fip.html&quot;&gt;image processing&lt;/a&gt; called &lt;strong&gt;&lt;a href=&quot;http://www.sigmapi-design.com/htmtutor/warp.htm&quot;&gt;warping&lt;/a&gt;&lt;/strong&gt;. In the case of &lt;strong&gt;&lt;a href=&quot;http://astronomy.swin.edu.au/~pbourke/projection/imagewarp/&quot;&gt;warping&lt;/a&gt;&lt;/strong&gt;, we take the intensity values found on a certain pixel and &lt;em&gt;move&lt;/em&gt; them to another pixel. The most common example of &lt;strong&gt;warping&lt;/strong&gt; is &lt;strong&gt;scaling&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;
The important thing to note here for both of these types of image processing techniques is that the function used for the process only takes into consideration the intensity value of a single pixel. In 
&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;
other words, it is agnostic to the values of intensity foudn in any other pixesl in a given image. These types of image processing is called &lt;strong&gt;point processing&lt;/strong&gt;. So, in &lt;strong&gt;point processing&lt;/strong&gt; the effect of the function applied to one point has no impact on any other points as all points are processed independentl of one another.
&lt;/p&gt;
&lt;p&gt;
In the next entry, we&#39;ll talk about specific examples of filters.
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://15463.blogspot.com/feeds/112646422261750925/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/16203594/112646422261750925' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112646422261750925'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112646422261750925'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/2005/09/basics-of-image-processing.html' title='Basics of Image Processing'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16203594.post-112684973407428721</id><published>2005-09-16T01:38:00.000-04:00</published><updated>2005-09-17T21:31:01.946-04:00</updated><title type='text'>Taking Advantage of the Human Eye Deficiency for Fun and Profit</title><content type='html'>&lt;p&gt;
Now that we know how it is that we&#39;re able to see what we see, let&#39;s talk about how the digital camera records the same information.
&lt;/p&gt;
&lt;p&gt;
Instead of rods and cones, the sleek &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;amp;amp;amp;ie=UTF-8&amp;oe=UTF-8&amp;amp;c2coff=1&amp;client=pub-7738110918761047&amp;amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;amp;q=slim+digital+camera&amp;btnG=Search&amp;amp;sitesearch=&quot;&gt;digital cameras&lt;/a&gt; you see on the market today contain a bunch of &lt;a href=&quot;http://www.kodak.com/US/en/corp/researchDevelopment/technologyFeatures/cmos.shtml&quot;&gt;CMOS sensors&lt;/a&gt;, and their bulkier ones contain another type of sensors called &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;amp;amp;amp;ie=UTF-8&amp;oe=UTF-8&amp;amp;c2coff=1&amp;client=pub-7738110918761047&amp;amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;amp;q=ccd+sensors&amp;btnG=Search&amp;amp;sitesearch=&quot;&gt;CCD sensors&lt;/a&gt;. These 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

sensors collect light information much like the film does, but since we&#39;re in the digial realm, the information gets collected at discrete points on the sensor array, and not in a continous manner as it is in the case of the film. These points are called &lt;a href=&quot;http://en.wikipedia.org/wiki/Pixel&quot;&gt;pixels&lt;/a&gt;, and the more pixels you have the more more light information you can gather at finer points along the sensor array. That&#39;s why you see those flashing advertisements about how the new &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;amp;ie=UTF-8&amp;oe=UTF-8&amp;amp;c2coff=1&amp;client=pub-7738110918761047&amp;amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;amp;q=5+megapixel&amp;btnG=Search&amp;amp;sitesearch=&quot;&gt;5 megapixel cameras&lt;/a&gt; are sooooo much better than the &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;amp;ie=UTF-8&amp;oe=UTF-8&amp;amp;c2coff=1&amp;client=pub-7738110918761047&amp;amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;amp;q=3+megapixel&amp;btnG=Search&amp;amp;sitesearch=&quot;&gt;3 megapixel&lt;/a&gt; ones from the yester years. (*SIGH* &lt;a href=&quot;http://www.dpreview.com/reviews/nikoncp2500/&quot;&gt;mine&lt;/a&gt; only has 2 mega piexels...)
&lt;/p&gt;
&lt;p&gt;
Now, if you remember from our &lt;a href=&quot;http://15463.blogspot.com/2005/09/let-there-be-light.html&quot;&gt;previous discussion&lt;/a&gt;, there are two variables that we care about when it comes to recording light: the number of photons and their respective wavelengths. To make our lives a bit easier, since we&#39;re only sensitive to light that reside within the &lt;a href=&quot;http://images.google.com/images?q=visible+spectrum&amp;hl=en&amp;amp;hs=Ql7&amp;lr=&amp;amp;c2coff=1&amp;client=firefox-a&amp;amp;rls=org.mozilla:en-US:official&amp;sa=N&amp;amp;tab=ii&amp;oi=imagest&quot;&gt;blue and red boundaries&lt;/a&gt; of the electromagnetic spectrum, we actually &lt;em&gt;only&lt;/em&gt; care about the photons that have wavelengths that fit within those boundaries. So the goal of a digital camera boils down to recording the &lt;strong&gt;number of photons&lt;/strong&gt; and their &lt;strong&gt;wavelengths&lt;/strong&gt; encountered at every pixel where the wavelength is within the visible spectrum. &lt;/p&gt;
&lt;p&gt;
If we were to model the digital camera after the fact that the human eye has 3 cones responsible for the red, green and blue colors respectively, we&#39;d use 3 sensor arrays to store the 3 different ranges of the color spectrum separately. The problem with that approach would be that it requires lots of sensors. In reality, what you&#39;ll find in most consumer digital cameras is a single-chip design that contains just &lt;em&gt;one&lt;/em&gt; array of sensors. So we&#39;re obviously going to have to make some trade offs here. To store all three channels of color information on a single array of sensors, we use a technique called the &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Bayer_filter&quot;&gt;Bayer filter&lt;/a&gt;&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
The &lt;strong&gt;Bayer filter&lt;/strong&gt; encodes 3 different color informations on a single grid of pixel arrays in such a way that a decent &lt;a href=&quot;http://www.fillfactory.com/htm/technology/htm/rgbfaq.htm&quot;&gt;reconstruction algorithm&lt;/a&gt; can be run to produce an acceptable replica of the real scene being captured. &lt;a href=&quot;http://en.wikipedia.org/wiki/Image:BayerPatternFiltration.jpg&quot;&gt;Notice&lt;/a&gt; how each pixel only encodes 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

information from a &lt;em&gt;single color channel&lt;/em&gt;. (Don&#39;t you feel robbed now that you realize the 5 mega pixel camera you own really &lt;em&gt;isn&#39;t&lt;/em&gt; a 5 mega pixel camera, after all? =P) You might have also noticed that there are more pixels dedicated to green than the other two colors. The idea is that since we&#39;re &lt;a href=&quot;http://users.rcn.com/jkimball.ma.ultranet/BiologyPages/V/Vision.html&quot;&gt;most sensitive to green&lt;/a&gt;, we&#39;d be better able to deduce the brightness of the overall image through the particular range of colors available in the green spectrum. These feable machines are just trying to piggyback on our brain, you see. ;)
&lt;/p&gt;
&lt;p&gt;
So your digital camera, apart from the crappy single chip design, sounds like a damn fine piece of machinery capable of recording all the light information we need, eh? Well, not even &lt;em&gt;close&lt;/em&gt;. The main limitation of your digital camera is that it is completely &lt;em&gt;incapable&lt;/em&gt; of capturing the vast range of light intensities found in the real world.
&lt;/p&gt;
&lt;p&gt;
You see, the range of light intensity a digital camera can capture at any given pixel is from 0 to 255. That&#39;s a mighty small number compared to the &lt;a href=&quot;http://www.cybergrain.com/tech/hdr/&quot;&gt;high dynamic range found in the real world&lt;/a&gt;. So what happens is that once the number of photons that are found at a certain pixel goes beyond 255, your digital camera will consider it to be as saturated as it can be. Try taking a picture outside on a 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

sunny day with long exposure, and your camera will end up gathering so much photons per pixel that your image will probably be mostly white. You could simply shorten the exposure, but then you wouldn&#39;t have had ample time to collect enough photons on certain pixels, leading parts of the image way too dark. So whatever mapping the digital camera does to take the actual number of photons colleted at a given pixel and turn it into a value between 0 and 255, that is going to be a major limiting factor in producing the same image as perceived by our eyes.
&lt;/p&gt;

&lt;p&gt;
As much as you now see how crappy your digital camera really is, that isn&#39;t to say that our eyes are leaps and bounds better. While it&#39;s true that our eyes have a much better range, it &lt;em&gt;still isn&#39;t enough&lt;/em&gt; to cover the entire range found in the real world. So our eyes have to depend on some sort of a remapping as well. We can take a look at the &lt;a href=&quot;http://en.wikipedia.org/wiki/Craik-O&quot;&gt;corn sweet illusion&lt;/a&gt; to illustrate this phenomenon. If our eyes are able to accurately record the true intensity values of light, then we should have no problem perceiving the absolute brightness of the image at any given position. But, as you can see, &lt;a href=&quot;http://www.mindbreakers.com/visual-illusions/uncanny.htm&quot;&gt;we can&#39;t&lt;/a&gt;. =P &lt;/p&gt;&lt;p&gt;Then again.... As it is with other things in life, perhaps too much of everything isn&#39;t the best thing to have. Heck, if it weren&#39;t for the limitations of our eyes, the whole &lt;a href=&quot;http://webexhibits.org/colorart/monet.html&quot;&gt;impressionism&lt;/a&gt; movement of the 1870s wouldn&#39;t have even existed, and that, in my humble opinion, would have put a quite a damper on the onslaught of very interesting non-photo-realistic art forms to come. ;)
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://15463.blogspot.com/feeds/112684973407428721/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/16203594/112684973407428721' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112684973407428721'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112684973407428721'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/2005/09/taking-advantage-of-human-eye.html' title='Taking Advantage of the Human Eye Deficiency for Fun and Profit'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16203594.post-112646428747864548</id><published>2005-09-15T02:44:00.000-04:00</published><updated>2005-09-17T01:54:11.256-04:00</updated><title type='text'>Let there be light!</title><content type='html'>&lt;p&gt;
Now that we&#39;ve gotten the basic idea of how photography works, we&#39;re well on our way to moving into the digital realm. But, before we move on, I think it&#39;s important to first get a good general understanding of how the &lt;a href=&quot;http://webvision.med.utah.edu/&quot;&gt;human eye&lt;/a&gt; functions. So let&#39;s put our physcist caps back on, and talk a little bit about light and the human eye.
&lt;/p&gt;
&lt;p&gt;
Despite the constant nod to the great &lt;a href=&quot;http://www.2think.org/eye.shtml&quot;&gt;evolutionary wonder&lt;/a&gt; that is the &lt;a href=&quot;http://www.solux.net/edu13.htm#Daylight:%20What%20it%20is,%20and%20some%20surprising%20findings&quot;&gt;human eye&lt;/a&gt;, our eyes are &lt;a href=&quot;http://www.2think.org/hii/messag15.shtml#66&quot;&gt;far from being perfect&lt;/a&gt;. The interesting thing is that, as you&#39;ll see, the limitations of our eyes make things easier to create technologies that are not perfect, but good enough for us mere mortals. =) So let&#39;s start with the basics.
&lt;/p&gt;
&lt;p&gt;
The mechanics of our eyes are quite similar to that of the camera (Hmm... I suppose I should say that the other way around ^^;). We have the &lt;strong&gt;pupil&lt;/strong&gt; which is equivalent to the &lt;strong&gt;aperture&lt;/strong&gt;, and its size is controled by the &lt;strong&gt;iris&lt;/strong&gt; which contracts and expands to control the amount of light that is let through. At the back of our &lt;a href=&quot;http://www.accessexcellence.org/AE/AEC/CC/vision_background.html&quot;&gt;eyes&lt;/a&gt; is the retina that contains a bunch of photoreceptor cells that take on the role of the film. There are two types of light-sensitive receptors. 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

The first type of receptors, found mostly in the &lt;a href=&quot;http://hyperphysics.phy-astr.gsu.edu/hbase/vision/retina.html#c2&quot;&gt;center of the retina&lt;/a&gt;, is called &lt;strong&gt;&lt;a href=&quot;http://hyperphysics.phy-astr.gsu.edu/hbase/vision/rodcone.html#c3&quot;&gt;cones&lt;/a&gt;&lt;/strong&gt;. &lt;strong&gt;Cones&lt;/strong&gt; operate primilary under high light conditions, and although they are not very sensitive to lights, they take on the important role of granting color sensitivity to our eyes. Next we have the &lt;strong&gt;&lt;a href=&quot;http://hyperphysics.phy-astr.gsu.edu/hbase/vision/rodcone.html#c3&quot;&gt;rods&lt;/a&gt;&lt;/strong&gt; which primarily operate under low light conditions. Rods are much more sensitive to light than the cones, but can only sense gray-scale. The amount of each type used at any given point in time depends heavily on the amount of light present.
&lt;/p&gt;
&lt;p&gt;
So, let&#39;s talk about lights. Human beings can only interpret a small portion of the entire &lt;a href=&quot;http://en.wikipedia.org/wiki/Electromagnetic_spectrum&quot;&gt;electromagnetic spectrum&lt;/a&gt;. The current guess is that we have evolved through the years of being exposed to the sun as our primary light source, and so we&#39;ve become accustomed to being sensitive to wavelengths of the photons found in sun light. This range of colors are referred to as our &lt;a href=&quot;http://imagers.gsfc.nasa.gov/ems/visible.html&quot;&gt;&lt;strong&gt;visible spectrum&lt;/strong&gt;&lt;/a&gt; and spans from lights that h</content><link rel='replies' type='application/atom+xml' href='http://15463.blogspot.com/feeds/112646428747864548/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/16203594/112646428747864548' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112646428747864548'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112646428747864548'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/2005/09/let-there-be-light.html' title='Let there be light!'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16203594.post-112640941962163229</id><published>2005-09-14T23:28:00.000-04:00</published><updated>2005-09-15T01:37:23.250-04:00</updated><title type='text'>Realizing Prokudin-Gorskii&#39;s Dream</title><content type='html'>&lt;p&gt;
Soooo... We had our first assignment. You can read more about it &lt;a href=&quot;http://graphics.cs.cmu.edu/courses/15-463/2005_fall/www/hw/proj1/proj1.html&quot;&gt;here&lt;/a&gt;. The gist of the assignment was that you&#39;d be given 3 gray scale photographs of the same scene, where &lt;a href=&quot;http://www.loc.gov/exhibits/empire/gorskii.html&quot;&gt;each photograph had been taken through blue, green and red filters respectively&lt;/a&gt;. You&#39;re required to take that as your source and produce a colorized &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;ie=UTF-8&amp;oe=UTF-8&amp;c2coff=1&amp;client=pub-7738110918761047&amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;q=define%3Acomposite+image&amp;btnG=Search&amp;sitesearch=&quot;&gt;composite&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
So here is a sample image:
&lt;/p&gt;

&lt;a target=&quot;_blank&quot; href=&quot;http://photos1.blogger.com/blogger/2770/23/1600/00153v.jpg&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot; class=&quot;photo&quot; src=&quot;http://photos1.blogger.com/blogger/2770/23/320/00153v.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;p&gt;
As you can see, it contains 3 photographs of the same scene where the top one represented the blue channel, the next green, and the last red. 
&lt;/p&gt;
&lt;p&gt;
So I thought, ok that seems simple enough, I&#39;ll just cut the long image into 3 equally sized chunks, take the gray scale value from the top one, use it as the value for &quot;B&quot; in the (R, G, B) triplet of the final color composite, rinse, lather, and repeat for &quot;G&quot; and &quot;R&quot;. 
&lt;/p&gt;
&lt;p&gt;
After about 10 lines of matlab code, I was able to produce the following composite: 
&lt;/p&gt;
&lt;a target=&quot;_blank&quot;  href=&quot;http://photos1.blogger.com/blogger/2770/23/1600/jiggly_composite3.jpg&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot;  class=&quot;photo&quot; src=&quot;http://photos1.blogger.com/blogger/2770/23/200/jiggly_composite1.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;p&gt;
Man, doesn&#39;t it take you back to the good ol&#39; days of staring into those &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;ie=UTF-8&amp;oe=UTF-8&amp;c2coff=1&amp;client=pub-7738110918761047&amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;q=0312278144&amp;btnG=Search&amp;sitesearch=&quot;&gt;nutty images&lt;/a&gt; out of them 3D books with the cheapo &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;ie=UTF-8&amp;oe=UTF-8&amp;c2coff=1&amp;client=pub-7738110918761047&amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;q=3d+glasses&amp;btnG=Search&amp;sitesearch=&quot;&gt;3D glasses&lt;/a&gt;? Awwwww.... Hours and hours of fun! ^^
&lt;/p&gt;
&lt;p&gt;
Well, so the first obvious challenge here was to align the three images up so that they&#39;re correctly superimposed. The assignment suggested that we try a couple different metrics that, given two images, can give us an idea of how close thay match up. The first approach was to calculate the &lt;strong&gt;sum of squared differences&lt;/strong&gt; or &lt;strong&gt;SSD&lt;/strong&gt;. You might think it sounds fancy, but once you start taking the name literally, it becoms quite clear that it&#39;s dead simple. What you do is you take the differences in values at a given point on the two images, square it to get a positive value, then just add&#39;em all up. If the number is low, that means there&#39;s not much difference between the two, and if the number is high, well... you get the idea. 
&lt;/p&gt;
&lt;p&gt;
The second method was to calculate the &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;ie=UTF-8&amp;oe=UTF-8&amp;c2coff=1&amp;client=pub-7738110918761047&amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;q=normalized+cross-correlation&amp;btnG=Search&amp;sitesearch=&quot;&gt;&lt;strong&gt;normalized cross-correlation&lt;/strong&gt;&lt;/a&gt; value or &lt;strong&gt;NCC&lt;/strong&gt;. As you may already know, when we talk about measuring the &lt;a href=&quot;http://astronomy.swin.edu.au/~pbourke/other/correlate/&quot;&gt;correlation&lt;/a&gt; between two given patterns (an image being just a pattern of color values), what we&#39;re trying to find out is how closely the two &quot;co-vary&quot;. In other words, we&#39;re trying to find out how similar of a pattern the two are. This time, the &lt;em&gt;higher&lt;/em&gt; the value, the more similar they would be.
&lt;/p&gt;
&lt;p&gt;
So there you have&#39;em, &lt;strong&gt;SSD&lt;/strong&gt; and &lt;strong&gt;NCC&lt;/strong&gt;. Now, how can we use these measurements to find out the correct way to superimpose the 3 images? Well, the simplest way would be to keep one image in place, superimpose another one, calculate either the &lt;strong&gt;NCC&lt;/strong&gt; or the &lt;strong&gt;SSD&lt;/strong&gt; value, slide it a lil bit, calculate the values again, etc... until you find yourself a decent &lt;strong&gt;SSD&lt;/strong&gt; or &lt;strong&gt;NCC&lt;/strong&gt; value that you&#39;re happy with. The amount by 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

which you had to move the second image before ending up at that value would be your choice of displacment for the image. This process is also known as &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Convolution&quot;&gt;convolution&lt;/a&gt;&lt;/strong&gt;. So, what I did was I specified a 15x15 window of displacement that the second image could slide around in, and found the displacement that yielded the biggest &lt;strong&gt;NCC&lt;/strong&gt; value. I did this for the blue and green channels pair and repeated it for the blue and red channels pair to align&#39;em all up.
&lt;/p&gt;

&lt;p&gt;
With this new feature implemented, the script shifted the green channel by 0, 6 and the red by 0, 13 before superimposing the two on top of the blue channel. The result seemed decent. 
&lt;/p&gt;
&lt;a target=&quot;_blank&quot; href=&quot;http://photos1.blogger.com/blogger/2770/23/1600/00153v.composite.ncc.jpg&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot;  class=&quot;photo&quot; src=&quot;http://photos1.blogger.com/blogger/2770/23/200/00153v.composite.ncc.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;p&gt;
Now, do you notice how this image lacks the black border found in the original? Well, the clump of blackness messed up my calculations, so I chopped them off before aligning them up. The above photograph was particularly tricky because there were parts toward the bottom of one of the pictures that kept skewing the result. I could have probably spent more time finding a better area for comparison, or devised an automated approach such as &lt;a href=&quot;http://www.pages.drexel.edu/~weg22/can_tut.html&quot;&gt;edge detection&lt;/a&gt; to discard the portions of the channels where there would have been too strong of a match (i.e. clump of blackness compared to clump of blackness). Well, maybe, next time. ;)
&lt;/p&gt;
&lt;p&gt;
So, is that it, you ask. Well, &lt;em&gt;that&lt;/em&gt; woulda been suh-weeeeet, cuz at about this point I&#39;ve had grown somewhat of an allergic reaction to &lt;a href=&quot;http://www.mathworks.com/&quot;&gt;matlab&lt;/a&gt;&#39;s quirky syntax. ;) So, no, it wasn&#39;t over, yet.
&lt;/p&gt;
&lt;p&gt;
The second challenge came in the form of performance optimization. Calculating the &lt;strong&gt;SSD&lt;/strong&gt; or &lt;strong&gt;NCC&lt;/strong&gt; values over a 15x15 displacement window isn&#39;t horrible. Throw a &lt;a href=&quot;http://intel.com/products/processor/pentium4/index.htm?iid=ipc+desktop_info_p4ht&amp;&quot;&gt;P4&lt;/a&gt; at it, and you&#39;ll get the images aligned in no time. Now, things get funky when we need to align images that are bigger, like... &lt;em&gt;a lot&lt;/em&gt; bigger. The main issue would be 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

that we can no longer be content with a measley 15x15 displacement window, since, depending on how big the image is, we might have to bump that up to 100x100, or worse yet, 200x200 before finding a decent displacement amount!!! That would kinda suck... So we were given an algorithm that could potentially save us from having to spend days on end in the cluster: the &lt;strong&gt;&lt;a href=&quot;http://www.cs.huji.ac.il/course/2003/impr/lectures2001/pyramid.pdf&quot;&gt;Gaussian pyramid&lt;/a&gt;&lt;/strong&gt;, aka the &lt;strong&gt;&lt;a href=&quot;http://library.wolfram.com/examples/pyramid/&quot;&gt;Burt-Adelson pyramid&lt;/a&gt;&lt;/strong&gt;. If you&#39;re wondering why it is named after Gauss instead of the actual folks that first applied this idea to image processing, read &lt;a href=&quot;http://www.cs.huji.ac.il/course/2003/impr/lectures2001/pyramid.pdf&quot;&gt;this&lt;/a&gt; and you&#39;ll get to know why. =)
&lt;/p&gt;
&lt;p&gt;
Anyway, the idea behind the &lt;strong&gt;Gaussian pyramid&lt;/strong&gt; is that, instead of calculating the &lt;strong&gt;SSD&lt;/strong&gt; or &lt;strong&gt;NCC&lt;/strong&gt; values on the &lt;em&gt;full&lt;/em&gt; image, we can calculate them on a &lt;em&gt;scaled down&lt;/em&gt; version of the image. The image would obviously have to be small enough so that we &lt;em&gt;can&lt;/em&gt; be happy with a measley 15x15 displacment window. When we get the &lt;strong&gt;SSD&lt;/strong&gt; or &lt;strong&gt;NCC&lt;/strong&gt; value on the scaled down image, we can first shift the image by that amount, scale the image &lt;em&gt;back up&lt;/em&gt; a notch, rinse, lather repeat until we&#39;re back to our full resoltion image. So you see, the whole point is that since we&#39;re progressively shifting the image, the use of 15x15 displacment window can be good enough throughout the process, and &lt;em&gt;oooooh yes&lt;/em&gt;, it runs much faster. ;)
&lt;/p&gt;
&lt;p&gt;
With all this done, I was curious to try and see if I can run my script through my very own RGB filtered photos. So I ripped some &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;ie=UTF-8&amp;oe=UTF-8&amp;c2coff=1&amp;client=pub-7738110918761047&amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;q=Transparent+Colored+Tabs&amp;btnG=Search&amp;sitesearch=&quot;&gt;transparent filing labels&lt;/a&gt; off of my folders (yeah, I&#39;m that cheap) and got down and dirty. ;) Here&#39;s what I ended up with
&lt;/p&gt;
&lt;a  target=&quot;_blank&quot; href=&quot;http://photos1.blogger.com/blogger/2770/23/1600/dj.jpg&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot; class=&quot;photo&quot; src=&quot;http://photos1.blogger.com/blogger/2770/23/200/dj.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;p&gt;
Here&#39;s the post-processed image:
&lt;/p&gt;
&lt;a  target=&quot;_blank&quot; href=&quot;http://photos1.blogger.com/blogger/2770/23/1600/dj.composite.ncc.jpg&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot; class=&quot;photo&quot; src=&quot;http://photos1.blogger.com/blogger/2770/23/200/dj.composite.ncc.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;

&lt;p&gt;
Now, it&#39;s pretty obvious the result sucks royal ass... Hmmph! I blame it on my sucky filters... =P In an attempt to try and see if I can make it any better, I implemented a simple white balancing script to get the following image:
&lt;/p&gt;
&lt;a  target=&quot;_blank&quot; href=&quot;http://photos1.blogger.com/blogger/2770/23/1600/dj.composite.ncc.wb.jpg&quot;&gt;&lt;img style=&quot;cursor:pointer; cursor:hand;&quot;  class=&quot;photo&quot; src=&quot;http://photos1.blogger.com/blogger/2770/23/200/dj.composite.ncc.wb.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;

&lt;p&gt;
Hmm... I suppose that&#39;s at least recognizable... ^^; Here is what it was supposed to look like:
&lt;/p&gt;
&lt;a  target=&quot;_blank&quot; href=&quot;http://photos1.blogger.com/blogger/2770/23/1600/dj.original.jpg&quot;&gt;&lt;img class=&quot;photo&quot; style=&quot;cursor:pointer; cursor:hand;&quot; src=&quot;http://photos1.blogger.com/blogger/2770/23/200/dj.original.jpg&quot; border=&quot;0&quot; alt=&quot;&quot; /&gt;&lt;/a&gt;
&lt;p&gt;
&lt;p&gt;
So that&#39;s the end of the first assignment! If you&#39;re interested in taking a look at all the photographs that I have processed using my script, head over &lt;a href=&quot;http://www.cs.cmu.edu/afs/andrew/scs/cs/15-463/pub/www/projects/proj1/slim/&quot;&gt;here&lt;/a&gt;. 
I just hope &lt;a href=&quot;http://en.wikipedia.org/wiki/Sergei_Michailowitsch_Prokudin-Gorski&quot;&gt;Prokundin-Gorksii&lt;/a&gt; can rest in peace now! :)
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://15463.blogspot.com/feeds/112640941962163229/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/16203594/112640941962163229' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112640941962163229'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112640941962163229'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/2005/09/realizing-prokudin-gorskiis-dream.html' title='Realizing Prokudin-Gorskii&#39;s Dream'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16203594.post-112637829411916429</id><published>2005-09-10T14:51:00.000-04:00</published><updated>2005-09-12T05:03:29.463-04:00</updated><title type='text'>Light, Camera, Zoom!</title><content type='html'>&lt;p&gt;
I&#39;m picking up from the entry on the &quot;&lt;a href=&quot;http://15463.blogspot.com/2005/09/fundamentals-of-photography.html&quot;&gt;Fundamentals of Photography&lt;/a&gt;&quot;, so be sure to start there if you have missed it! ;) 
&lt;/p&gt;
&lt;p&gt;
The first concept that I had trouble wrapping my head around was the concept of &lt;strong&gt;field of view&lt;/strong&gt;. The term comes into play when we talk about the second most popular topic for stalkers and &lt;a href=&quot;http://www.nieldsnook.org/paparazzi.html&quot;&gt;paparazzis&lt;/a&gt;: zooming. I&#39;m guessing that the first would be &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;amp;amp;ie=UTF-8&amp;oe=UTF-8&amp;amp;c2coff=1&amp;client=pub-7738110918761047&amp;amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;amp;q=infrared+photography&amp;sitesearch=&quot;&gt;infrared&lt;/a&gt; or &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;amp;amp;lr=&amp;ie=UTF-8&amp;amp;oe=UTF-8&amp;c2coff=1&amp;amp;client=pub-7738110918761047&amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;q=x-ray+photography&amp;amp;btnG=Search&amp;sitesearch=&quot;&gt;x-ray photography&lt;/a&gt; for the &lt;a href=&quot;http://www.chopstork.com/Wikka/OjiSan&quot;&gt;hentai ojisans&lt;/a&gt; out there. =P At any rate, humor me while I try my best to explain the mechanics of zooming without getting confused all over again.
&lt;/p&gt;
&lt;p&gt;
So, let&#39;s think for a moment about the effect we get when we press that trusty ol&#39; zoom button on our cameras. What does it look like is happening? Well, to me it looks like the camera is basically taking a portion out of the &lt;em&gt;center of the image&lt;/em&gt; and bringing it closer to me. *DUH*, you might say. Well, the subtle point I was trying to make by emphasizing the phrase &lt;em&gt;&quot;center of the image&quot;&lt;/em&gt; was that zooming is &lt;em&gt;NOT&lt;/em&gt; the same as taking a picture of the object when you&#39;re physically up close to it. The distinction arises from the fact that zooming 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

involves putting the lens, but &lt;em&gt;not the screen&lt;/em&gt; on which the image gets projected on, closer to the object than it really is. In physics speak, what we&#39;re trying to do here is increase the &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Focal_length&quot;&gt;focal length&lt;/a&gt;&lt;/strong&gt;. So, why does increasing the &lt;strong&gt;focal length&lt;/strong&gt; magnify the image, you ask. It&#39;s quite simple actually. To explain this phenomenon, we have to introduce that term I talked about at the top of this entry: &lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Field_of_view&quot;&gt;field of view&lt;/a&gt;&lt;/strong&gt;.
&lt;/p&gt;
&lt;p&gt;
&lt;strong&gt;Field of view&lt;/strong&gt; is the area which you&#39;re actually able get portrayed as an image in the viewfinder of your camera. In real life, the &lt;strong&gt;field of view&lt;/strong&gt; defines what you can actually see with your eyes. For example, you can hopefully see what&#39;s directly in front of you, and if so, chances are good that you can also see things that are slightly off to the side, but you damn well can&#39;t see directly to the left or right unless you turn your head around. So the &lt;strong&gt;field of view&lt;/strong&gt; is defined by the horizontal and vertical angles that you have visual access to.
&lt;/p&gt;
&lt;p&gt;
So how are &lt;strong&gt;focal length&lt;/strong&gt; and &lt;strong&gt;field of view&lt;/strong&gt; related? Well, when you increase the focal length, the &lt;strong&gt;field of view&lt;/strong&gt; shrinks. Think about it. The screen on which the image is projected on is of a finite size, and as you move the lens away from the screen to increase the focal length, the light rays will end up getting refracted by the lens &lt;em&gt;sooner&lt;/em&gt;. This increases the distances traveled by the refracted rays before they hit the screen. As a result, the light rays will get projected further out on the screen, hence producing a magnified image. Now, as you zoom more and more, the rays that get refracted at higher angles will soon be out of reach by the fixed area of the screen. This leaves you 


&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

with only the rays that don&#39;t get refracted as much. So if you think about it, when you zoom, you&#39;re essentially bombarding most of your screen with rays of light that are exiting the lens at more or less parallel angles to the horizontal axis. In other words, you&#39;re throwing away much of the perspective information that would have normally been captured, so your image will no longer have much depth to it. That makes image captured through zooming, different from that captured up close.
&lt;/p&gt;

&lt;p&gt;
Depthless or not, people can&#39;t seem to get enough this zooming business! Not only do we have cameras with &lt;a href=&quot;http://www.brainboost.com/search.asp?Q=How+does+an+optical+zoom+work&quot;&gt;optical&lt;/a&gt; &lt;em&gt;and&lt;/em&gt; &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;amp;lr=&amp;amp;ie=UTF-8&amp;oe=UTF-8&amp;amp;c2coff=1&amp;client=pub-7738110918761047&amp;amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;amp;q=digital+zoom&amp;btnG=Search&amp;amp;sitesearch=&quot;&gt;digital zoom&lt;/a&gt; features, you could literally &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;amp;amp;ie=UTF-8&amp;oe=UTF-8&amp;amp;c2coff=1&amp;client=pub-7738110918761047&amp;amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;amp;q=zoom+lens&amp;btnG=Search&amp;amp;sitesearch=&quot;&gt;buy lenses&lt;/a&gt; that let you zoom further and at higher qualities. They don&#39;t come cheap, and they&#39;re a pain in the ass to carry around, but they seem to sell pretty well. So something&#39;s gotta give, right? =P
&lt;/p&gt;
&lt;p&gt;
There&#39;s also the subject of radial distortion, namely pin cushion and barrel distortions, that are often brought up while talking about the various phenomenon related to lenses. Well, unfortunately, the class never really dove into the details of what exactly causes these effects. The gist of it, however, is that the lens you have may be screwing your image up, but if you believe your bottle is half full, these distortions can become cool visual effects! I say either curse incessantly at your crappy lens or bask in glory as your friends drool at your artistically shape-shifted imagery. ;)
&lt;/p&gt;
&lt;p&gt;
Phew! Allllllrighty! This completes the &quot;&lt;a href=&quot;http://15463.blogspot.com/2005/09/fundamentals-of-photography.html&quot;&gt;Fundamentals of Photography&lt;/a&gt;&quot; entry. Next time we&#39;ll talk about the color spectrum and the human eye! Stay tuned!
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://15463.blogspot.com/feeds/112637829411916429/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/16203594/112637829411916429' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112637829411916429'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112637829411916429'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/2005/09/light-camera-zoom.html' title='Light, Camera, Zoom!'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16203594.post-112567607790455180</id><published>2005-09-10T01:29:00.000-04:00</published><updated>2005-09-11T12:48:47.723-04:00</updated><title type='text'>Fundamentals of Photography</title><content type='html'>&lt;p&gt;The classes are going pretty well, and many of the questions I&#39;ve had about photography have been getting answered one by one. This is kinda cool given that I didn&#39;t even know that I was going to get an education on photography to begin with. ^^; 
The answers came in the form of physics lessons, and I have to say it&#39;s been ages since I had revisited &lt;a href=&quot;http://en.wikibooks.org/wiki/Optics_(Physics_Study_Guide)&quot;&gt;optics&lt;/a&gt;. As a matter of fact, it almost feels as if this is the firs time I&#39;m being exposed to these concepts. My guess is that my previous encounters with these subject matters were more mechanical in nature. In other words I was taught how to solve physic problems, not to truly understand what kind of a real world phenomenon was taking place. We need to &lt;a href=&quot;http://www.jyi.org/volumes/volume6/issue7/features/pattanayak.html&quot;&gt;reform our education system&lt;/a&gt;, dammit! Hmm... I suppose I could have been slacking and just didn&#39;t keep up with the work at that time, too... heh heh... Anyway... Lemme stop blabbering and get on with our first real topic of the blog: Fundamentals of photography.&lt;/p&gt;

&lt;p&gt;The fundamental concept of photography on which all other facets are based on is the fact that a camera is basically &lt;a href=&quot;http://www.kodak.com/global/en/consumer/education/lessonPlans/pinholeCamera/&quot;&gt;a box that sits around collecting light rays that travel through a hole&lt;/a&gt;. Depending on the angle at which the light enters the hole, it&#39;ll meet with some plane behind the hole at a certain spot. The collection of light rays at these 
spots result in an image that we call a photograph. The physical hole through which 
light rays enter is called the 


&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

&lt;strong&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Aperture&quot;&gt;aperture&lt;/a&gt;,&lt;/strong&gt; and the point at which the &lt;strong&gt;aperture&lt;/strong&gt; resides is called the &lt;strong&gt;center of projection&lt;/strong&gt;. If you put a screen behind the &lt;strong&gt;aperture&lt;/strong&gt;, let light become projected on it,&lt;strong&gt; &lt;/strong&gt;and measure the distance from the &lt;strong&gt;center of projection&lt;/strong&gt; to the screen, you&#39;d get what is known as the &lt;strong&gt;&lt;a href=&quot;http://wiki.photoblogs.org/wiki/Effective_focal_length&quot;&gt;effective focal length&lt;/a&gt;&lt;/strong&gt; of the camera. Now, if you were put a &lt;em&gt;film&lt;/em&gt; in place of the screen, you&#39;ll be able to get yourself an imprint of the image projected on it. See, cameras aren&#39;t that complicated. ;)&lt;/p&gt;

&lt;p&gt;An unfortunate characteristic of this imprint that a camera produces, however, is that it is incapable of accurately encoding the angle and the distance between and among the objects portrayed in the image. The reason is simple; the image is 2D and the real world is 3D. However, what&#39;s really interesting is that when we humans look at these images we&#39;re somehow able to make sense of it in our heads as to what thse objects really look like and how they would be positioned in real life! It turns out that our brain does a lot of these work &lt;em&gt;for&lt;/em&gt; us to keep our sanity intact. Of course, the brain is only able to do this because it has been acquiring a lot of information through the eyes for a long time. It isn&#39;t without fault, however, as you can find instances where the information gathered can fool us into perceiving things incorrectly as well. The &lt;a href=&quot;http://www.michaelbach.de/ot/sze_muelue/index.html&quot;&gt;Muller-Lyer illusion&lt;/a&gt;, is a famouse illustration of such consequences.&lt;/p&gt;

&lt;p&gt;So with the help of our brain, these flat images that we&#39;ve managed to capture, turn out to be pretty neat things to have around. Given its usefulness, our forefathers probably thought this imaging device we call camera was worth spending some time to improve upon. One of the tricky design constraints that they noticed was that, the hole needed to be small enough to prevent too many rays originating from the same physical object from entering, yet large enough to let all the rays we &lt;em&gt;want&lt;/em&gt; through. The problem with letting in &lt;em&gt;too&lt;/em&gt; many rays of light reflected from the same physical object was that, the rays would enter the hole at different angles and scatter on to multiple 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

points on the screen, resulting in what we commonly refer to as a blur. So they managed to find a good size hole small enough to let the minimum number of rays in to produce a sharp image, but alas, with so little light passing through a hole of such small size, it was necessary for the photographer to stand around waiting for enough light rays to pass through the hole to produce a reasonably bright image.&lt;/p&gt;


&lt;p&gt;This brings us to another important element of photography: &lt;a href=&quot;http://en.wikipedia.org/wiki/Exposure_(photography)&quot;&gt;&lt;strong&gt;exposure&lt;/strong&gt;&lt;/a&gt;. &lt;strong&gt;Exposure&lt;/strong&gt; is basically the time a photographer spends collecting light rays on the film or, if you&#39;re using a &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;lr=&amp;amp;amp;amp;amp;amp;amp;amp;ie=UTF-8&amp;oe=UTF-8&amp;amp;c2coff=1&amp;client=pub-7738110918761047&amp;amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;q=digital+camera&quot;&gt;digital camera&lt;/a&gt;, a &lt;a href=&quot;http://en.wikipedia.org/wiki/Charge-coupled_device&quot;&gt;CCD&lt;/a&gt; or &lt;a href=&quot;http://electronics.howstuffworks.com/question362.htm&quot;&gt;CMOS&lt;/a&gt; sensor array. Have you ever wondered why photographs taken at night on a digital camera without flash sometimes come out to be blurry? Well that&#39;s because the camera opted to use long exposure in order to collect as much light as possible, but since you couldn&#39;t keep your hands steady for that entire duration of the exposure, light rays got collected at multiple spots and produced a blurry image. Next time invest on a &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;amp;amp;amp;amp;amp;lr=&amp;ie=UTF-8&amp;amp;oe=UTF-8&amp;c2coff=1&amp;amp;client=pub-7738110918761047&amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;q=tripod&amp;amp;btnG=Search&amp;sitesearch=&quot;&gt;tripod&lt;/a&gt;, or keep a few tablets of &lt;a href=&quot;http://www.google.com/custom?hl=en&amp;amp;amp;amp;amp;lr=&amp;ie=UTF-8&amp;amp;oe=UTF-8&amp;c2coff=1&amp;amp;client=pub-7738110918761047&amp;cof=FORID%3A1%3BGL%3A1%3BBGC%3AC6B396%3BT%3A%2344423a%3BLC%3A%23000000%3BVLC%3A%23000000%3BALC%3A%23000000%3BGALT%3A%23333333%3BGFNT%3A%23663333%3BGIMP%3A%23663333%3BDIV%3A%2337352E%3BLBGC%3A8E866F%3BAH%3Acenter%3B&amp;amp;domains=15463.blogspot.com%3Bgraphics.cs.cmu.edu&amp;q=diazepam&amp;amp;sitesearch=&quot;&gt;diazepam&lt;/a&gt; handy. ;)&lt;/p&gt;

&lt;p&gt;So to improve upon this &lt;a href=&quot;http://www.exploratorium.edu/light_walk/camera_todo.html&quot;&gt;pin-hole model&lt;/a&gt;, the &lt;a href=&quot;http://www.digitalhistory.uh.edu/historyonline/edison_mutoscope.cfm&quot;&gt;next batch of innovators&lt;/a&gt; used a &lt;a href=&quot;http://en.wikipedia.org/wiki/Camera_lens&quot;&gt;lens&lt;/a&gt; to grab rays of light that would have otherwise not passed through the hole, and directed them so that they would. This allowed the collection of more lights without long exposure.&lt;/p&gt;&lt;p&gt;Now, with the lens in our camera, we have a new measurement that we need to talk about; the &lt;a href=&quot;http://hyperphysics.phy-astr.gsu.edu/hbase/geoopt/foclen.html&quot;&gt;&lt;strong&gt;focal length&lt;/strong&gt;&lt;/a&gt;&lt;strong&gt;. &lt;/strong&gt;The &lt;strong&gt;focal length &lt;/strong&gt;of a lens is the distance from the optical center of a lens to the intersection point of all light rays that are parallel to the horizontal axis on which the lens stands once they get refracted. I know that sounds confusing, so take a look at &lt;a href=&quot;http://en.wikipedia.org/wiki/Focal_length&quot;&gt;these diagrams&lt;/a&gt; and see if they make more sense. Notice that this is different from the &lt;strong&gt;effective focal length&lt;/strong&gt; previously discussed.&lt;/p&gt;

&lt;p&gt;Unfotunately, plopping in a lens didn&#39;t only bring about a solution to our problem, but also presented some challenges. The artifact of having a lens was that, we now needed to care about &lt;em&gt;focus. &lt;/em&gt;What the hell does that mean? Well, depending on the angle at which rays of light reflected from various physical objects got bent by the lens, they would end up converging on several different planes. It was no longer possible to just have the film residing on one plane recive equally focused rays of light to produce a sharp image of the entire captured scene. You may have lights converging to a single point &lt;em&gt;behind&lt;/em&gt; where the film lies, which made the film collect the yet-to-be-focused rays of light and end up producing a blurry image of the object. So your entire image may not get blurred out, but objects located at different distances from the camera would end up with varying degrees of sharpness in the final photograph. There&#39;s even a cool term for the circular area of blurring you get when an object isn&#39;t focused! It&#39;s called &lt;strong&gt;circle of confusion.&lt;/strong&gt; How cool is that? &lt;/p&gt;

&lt;p&gt;The &quot;simple&quot; workaround for this problem is to shrink the &lt;strong&gt;aperture&lt;/strong&gt;. The reason &lt;a href=&quot;http://www.cs.mtu.edu/~shene/DigiCam/User-Guide/950/depth-of-field.html&quot;&gt;why this works&lt;/a&gt; requires us to think of the very reason why a blurry image gets produced in the first place; you&#39;re letting in more than one ray of light from the same physical object, and those extra rays are being projected onto multiple locations. So when you shrink the &lt;strong&gt;aperture&lt;/strong&gt;, you&#39;re letting less of the rays in, and, as a result, decreasing the number of multiple projections that can even occur. But, this turns out to be kind of an ironic way of solving the problem, because it&#39;s going against the whole bloody reason we went with a lense in the first place: brightness. You see, when we have a smaller &lt;strong&gt;aperture&lt;/strong&gt;, the amount of light that gets to pass through it, and, ultimately, the lens, is less than before, thus requiring more exposure to make up for it. Sounds like we&#39;re going around in circles, no? Well, the good news is that people have found aesthetical appeal in this artifact. They call it the &lt;a href=&quot;http://www.mir.com.my/rb/photography/fototech/htmls/depth.html&quot;&gt;use of the&lt;strong&gt; depth of field effect&lt;/strong&gt;&lt;/a&gt;. &lt;strong&gt;Depth of field &lt;/strong&gt;is the range at which the objects stay focused to 

&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

the naked eye. So when you talk about the effect of &lt;strong&gt;depth of field&lt;/strong&gt; in your photograph, you&#39;re basically talking about selecting a set of objects that you&#39;d like to keep in focus and another set of objects you&#39;d like to have blurred. Hey, when the scientists are down and out, artists are always there to cheer&#39;em up, I tell ya. ;)&lt;/p&gt;&lt;p&gt;Oook... So... This entry got super long... and I still have another topic to cover. Why don&#39;t I stop here, and talk about our next topic in a new entry? Alright? Stay tuned!&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://15463.blogspot.com/feeds/112567607790455180/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/16203594/112567607790455180' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112567607790455180'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112567607790455180'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/2005/09/fundamentals-of-photography.html' title='Fundamentals of Photography'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-16203594.post-112567271632532094</id><published>2005-09-02T10:25:00.000-04:00</published><updated>2005-09-10T23:18:57.070-04:00</updated><title type='text'>Ok, here we go</title><content type='html'>&lt;p&gt;
So I&#39;m taking another course at &lt;a href=&quot;http://www.cmu.edu/&quot;&gt;CMU&lt;/a&gt; this year. The course used to be called &quot;Computer Graphics 2&quot;, but they&#39;re now calling it &quot;&lt;a href=&quot;http://graphics.cs.cmu.edu/courses/15-463/&quot;&gt;Computational Photography&lt;/a&gt;&quot; which, depending on your taste, makes it artsy and hip, fake and boring or somewhere in between. The content does seem to have become much more 2D image manipulation and extraction oriented, though. When I was in school, it used to be half 2D image stuff and half 3D (ya know, the usual sub-division surfaces and other crap) The shift sort of bummed me out because now the class uses &lt;a href=&quot;http://www.mathworks.com/products/matlab/&quot;&gt;Matlab&lt;/a&gt; as opposed to just hacking straight &lt;a href=&quot;http://www.opengl.org&quot;&gt;OpenGL&lt;/a&gt;. I guess from the point of view of the material, it makes more sense to concentrate on the algorithms rather than the hacking sensation you get out of OpenGL... 


&lt;div class=&quot;adsense&quot;&gt;
&lt;script src=&quot;http://djslim.com/files/adsense_125x125box.js&quot;&gt;&lt;/script&gt;
&lt;script src=&quot;http://pagead2.googlesyndication.com/pagead/show_ads.js&quot;&gt;&lt;/script&gt;&lt;/div&gt;

Well, regardless of the title of the course or the programming language used, I knew I wanted to take it before I took the &lt;a href=&quot;http://www.cs.cmu.edu/~djames/15-864/&quot;&gt;next course&lt;/a&gt; on my list, so I didn&#39;t really care too much. Although... I really wanted to take the course when &lt;a href=&quot;http://www.google.com/url?sa=t&amp;ct=res&amp;cd=1&amp;url=http%3A//www-2.cs.cmu.edu/%7Eph/&amp;ei=ZmUYQ9KuE6KKsgGQ0KGnCw&quot;&gt;Professor Heckbert&lt;/a&gt; was teaching, but I have obviously missed that opportunity for good as all great Graphics professors continue to get &lt;a href=&quot;http://www.pixar.com/companyinfo/research/deb/&quot;&gt;snagged by korporate America&lt;/a&gt;. =( I&#39;m sure &lt;a href=&quot;http://www.cs.cmu.edu/~efros/&quot;&gt;Professor Efros&lt;/a&gt; will do fine, so I&#39;m not too worried. =)
&lt;/p&gt;
&lt;p&gt;
At any rate, the classes have begun this past Tuesday and the &lt;a href=&quot;http://graphics.cs.cmu.edu/courses/15-463/2005_fall/www/hw/proj1/proj1.html&quot;&gt;first assignment&lt;/a&gt; is out. I&#39;m going to try and make this blog take the form of semi-stream of consciousness, in the sense that I&#39;ll put posts up talking mostly about me trying to make sense out of the material. Hopefully if other people take the course and go through similar struggles as I do, they&#39;ll reap some benefit out of it. Plus I find that it helps me really understand the material when I try to inform others of what I&#39;ve learned. I don&#39;t claim that I&#39;m right in everything I say here, so if you find me spewing a load of crap out of my trap, be sure to tell me to shove it (correcting me would be &lt;em&gt;really&lt;/em&gt; cool, too)
&lt;/p&gt;
&lt;p&gt;
Alright, let&#39;s get hacking, shall we?
&lt;/p&gt;</content><link rel='replies' type='application/atom+xml' href='http://15463.blogspot.com/feeds/112567271632532094/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment/fullpage/post/16203594/112567271632532094' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112567271632532094'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/16203594/posts/default/112567271632532094'/><link rel='alternate' type='text/html' href='http://15463.blogspot.com/2005/09/ok-here-we-go.html' title='Ok, here we go'/><author><name>dJsLiM</name><uri>http://www.blogger.com/profile/05316903061665838350</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>