Graphics Reference
In-Depth Information
1
of convolution operation [RH04], and in rendering, in which the frequency anal-
ysis of light being transported in a scene can yield insights into the nature of
computations necessary to accurately simulate that light transport [DHS + 05].
0.5
Before discussing convolution and other operations, we return to the topic of
Section 9.4.2: the principle that you must know the meaning of every number in
a graphics program. Before we discuss operations like convolution and Fourier
transforms on images, we have to know what the images mean . The difficulty,
which we discussed briefly in Chapter 17, is that in some cases we just don't
know. Alvy Ray Smith made a point of this in a paper titled “A Pixel Is Not A
Little Square” [Smi95], in which he observes that the individual values in a pixel
array do not in general represent the average of something over a small square on
the image plane, and that algorithms that rely on this model of pixels are bound
to fail in some cases. (More simply, he points out that a pixel does not represent
a tiny square of constant value, even though the pixel may be displayed that way
on an LCD screen!) As an extreme example, an object ID image contains, at each
pixel, an identifier that tells which object is visible at that pixel. The pixel values
in this case are not even necessarily numerical!
0
−0.5
−1
0
2
4
6
Figure 18.7: The original sample
sin( x 0 ) in black, with two nearby
random samples, shown in red.
The average (green) of the three
heights is very nearly sin( x 0 ) .
1
For this chapter only, to avoid messiness introduced by shifting by one-half
in the x - and y -directions, we're going to use display screen coordinates in which
the display pixel indexed by ( 0, 0 ) has display coordinates that range from
0.5
1
2
to
1
2 in both x and y , and the display pixel named ( i , j ) is a small square centered at
( i , j ) rather than at ( i + 2 , j + 2 ) . This means that pixel ( i , j ) is at x -location i and
y -location j , and not in “row i and column j ”; that is, we're using geometric index-
ing rather than image indexing. Because this chapter contains no actual algorithms
that depend on display pixel coordinates, this should cause no problems for you.
For this chapter, we're going to assume (initially) that images contain physical
measurements of light, measured in physical units. For a digital camera, this might
be something like the average radiance along a ray hitting a small rectangle on a
CCD sensor, or perhaps an integral of that radiance over the area of that rectangle,
or the total light energy that arrived at the rectangle while the shutter was open.
(Some digital cameras will let you get such information when you store a photo
in “raw” mode, and will even tell you when the sensor was oversaturated so that
the stored value is a false measurement.) For a rendered image, the value stored
at a pixel might be the radiance along a ray that passed through the single point at
the center of the image area corresponding to the pixel, or an average of radiances
of several rays through the pixel, etc. It might even be an average of samples
from a region around the pixel center, where the regions for adjacent pixel centers
overlap .
0
−0.5
−1
0
2
4
6
Figure 18.8: Random samples
(red) of x sin( 11 x ) near
x = x 0 are quite different from
the sample at x 0 (black), so their
average (green) is nearer to zero.
Figure 18.9: The spectrum of an
audio signal displayed by several
intensity bars.
10
18.2 Historical Motivation
When graphics researchers first wanted to draw a line on a rectangular grid of
pixels, the most obvious thing to do was to write the line in the form y = mx + b ,
and for each integer x -value, compute y = mx + b , which was usually not an
integer, round it off to an integer y , and put a mark at location ( x , y ) . This only
works well if m is between
5
1 and 1; for greater slopes, it worked better to write
x = my + b , that is, to swap the roles of x and y , but that's not germane to this
discussion. The kind of line produced with this method is shown in Figure 18.10,
where we've drawn the line using little squares as pixel marks.
0
0
5
10
Figure 18.10: A line drawn with
one “pixel” per column.
 
 
 
Search WWH ::




Custom Search