<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5//EN" "http://cnx.rice.edu/technology/cnxml/schema/dtd/0.5/cnxml_plain.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:bib="http://bibtexml.sf.net/" id="id5435717">
<name>Exploring High Dynamic Range Imaging: §3.7 Stochastic Gain Control</name>
<metadata>
  <md:version>1.2</md:version>
  <md:created>2006/12/16 21:42:54 US/Central</md:created>
  <md:revised>2006/12/25 16:41:38.635 US/Central</md:revised>
  <md:authorlist>
      <md:author id="tyang">
      <md:firstname>Tianhe</md:firstname>
      
      <md:surname>Yang</md:surname>
      <md:email>tian.yang@rice.edu</md:email>
    </md:author>
      <md:author id="snmcgee">
      <md:firstname>Sarah</md:firstname>
      <md:othername>Nicole</md:othername>
      <md:surname>McGee</md:surname>
      <md:email>snmcgee@rice.edu</md:email>
    </md:author>
      <md:author id="tjohnson">
      <md:firstname>Taylor</md:firstname>
      <md:othername>T</md:othername>
      <md:surname>Johnson</md:surname>
      <md:email>ttj@rice.edu</md:email>
    </md:author>
      <md:author id="rlortman">
      <md:firstname>Robert</md:firstname>
      <md:othername>Lowell</md:othername>
      <md:surname>Ortman</md:surname>
      <md:email>rlortman@rice.edu</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="tyang">
      <md:firstname>Tianhe</md:firstname>
      
      <md:surname>Yang</md:surname>
      <md:email>tian.yang@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="snmcgee">
      <md:firstname>Sarah</md:firstname>
      <md:othername>Nicole</md:othername>
      <md:surname>McGee</md:surname>
      <md:email>snmcgee@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="tjohnson">
      <md:firstname>Taylor</md:firstname>
      <md:othername>T</md:othername>
      <md:surname>Johnson</md:surname>
      <md:email>ttj@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="rlortman">
      <md:firstname>Robert</md:firstname>
      <md:othername>Lowell</md:othername>
      <md:surname>Ortman</md:surname>
      <md:email>rlortman@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="Markpanzee">
      <md:firstname>Mark</md:firstname>
      <md:othername>A.</md:othername>
      <md:surname>Davenport</md:surname>
      <md:email>md@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="richb">
      <md:firstname>Richard</md:firstname>
      <md:othername>G.</md:othername>
      <md:surname>Baraniuk</md:surname>
      <md:email>richb@rice.edu</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  

  <md:abstract/>
</metadata>
<content>
<para id="id9246442">In computer graphics, ray tracing is a technique
used to project three dimensional space onto a two dimensional
plane as seen from an eye point. The basic ray tracing algorithm is
to fire a ray from the eye point through every pixel in the
display. If the ray intersects something in the scene, keep the
closest intersection point and calculate the intensity at that
point. The following novel algorithm which we designed, the Stochastic Gain Control operator, was
inspired by distributed ray tracing. 
<note type="footnote">Ron Goldman, “Lecture 17: Recursive Ray
Tracing” (Houston: Rice University, 25 Oct 2006) 1.</note>One problem though is that,
since each pixel really represents a fixed area of the scene
instead of a fixed point, one sample for the whole pixel may not
capture all of the information in that area. This leads to jagged
edges often called aliasing.
<note type="footnote">Arnold Martin, “Distributed Ray Tracing”
(Worcester: Worcester Polytechnic Institute, 1999)
&lt;http://www.owlnet.rice.edu/~comp360/lectures/RayTracing.pdf&gt;.</note>Therefore,
anti-aliasing techniques are used to soften the edges in a ray
tracer.</para>
<para id="id8187293">One such technique is called supersampling. By
firing multiple, evenly spaced rays over the pixel area, the
intensities calculated for each ray are averaged to find the
overall intensity in the pixel.
<note type="footnote">Donald Hearn and M. Pauline Baker, Computer
Graphics (2nd ed. Englewood Cliffs: Prentice Hall, 1994)
538-9.</note>This is similar to the Pattanaik-Yee Adaptive Gain
Control operator. Unfortunately, by uniformly sampling each pixel,
the image may appear blurry in some parts or have rigid variations
in other parts. This can be solved by using distributed ray
tracing.</para>
<para id="id5578360">In distributed ray tracing, rays are randomly
fired over a finite pixel area and then averaged together. Surface
lighting is usually defined as multiple integrals, so using a Monte
Carlo method to sample the integrand at randomly chosen points
results in a better approximation. While the aliasing is removed,
it will lead to a small amount of noise in the picture, but overall
the picture quality will be improved.
<note type="footnote">Hearn 541.</note></para>
<para id="id9334821">Using this idea, modifications can be made to
the averaging local operator. As the window sweeps across the
image, randomly selected pixels are averaged together. Since the
pixels are randomly selected, the same pixel may be selected more
than once. Thus, some pixels are weighted more than others. This
acts as a weighted pixel mask or pseudo Gaussian filter.</para>
<figure id="id9336064">
<media type="image/png" src="Graphic1.png"/>
</figure>
<para id="id9409307">If only one pixel is randomly selected inside
the window, the resulting image will be very blurry. This makes
sense because while sliding the window the same pixel may have
sampled repeatedly and at the same time failed to sample others. As
the number of pixels selected increases, the image becomes sharper
and sharper compared to the image produced by the Pattanaik-Yee
Adaptive Gain Control operator. However, if more than 125% of the
pixels in the window are selected, there will be no noticeable
change.</para>
<figure id="id3487234"><media type="image/png" src="memorialStochastic1.PNG"/>
	<caption>1 pixel sampled from a 3-by3 pixel window</caption></figure>
<figure id="id9872342"><media type="image/png" src="memorialStochastic5.PNG"/>
	<caption>5 pixels sampled from a 3-by3 pixel window</caption></figure>
<figure id="id1298462"><media type="image/png" src="memorialStochastic10.PNG"/>
	<caption>10 pixels sampled from a 3-by3 pixel window</caption></figure>
</content>
</document>
