Graphics Reference
In-Depth Information
done so at the cost of modifying the filter, however, so its Fourier transform is no
longer what we expected. As long as the ripple is small, though, the alteration to
the function is small, and hence the alteration to the transform is small as well.
The useful characteristic of this unrippling operation is that it suggests a way
to deal with the missing data at the edges of images as well: We compute the sum
target ( j )=
i
source ( i ) w ( j
i ) ,
(19.9)
but simply ignore all terms where source ( i ) is outside the image. We sum up
the weights as usual, but only for the terms we included, and then divide by this
sum. In the interior of the image, every pixel we need is available and we're just
unrippling. At the edges, we end up estimating the pixel values near the edge
based only on the image pixels near the edge, and not on some hallucinated values
on the other side of the edge. This method works surprisingly well in practice.
y = b 3 ( t )
0
−2
−1
0
1
2
19.5 Finite-Support Approximations
t
Figure 19.9: The cubic B-spline
filter.
We've said that the ideal reconstruction filter is sinc, but that it's often necessary to
compromise in practice and use a finite-support filter. We've already seen the box
and tent filters, and that the tent is the convolution b
b of the box with itself. We
can further convolve to get smoother and smoother filters as discussed extensively
in Chapter 22, which is about the construction of piecewise-smooth curves. The
convolution of the tent with itself (or b
y
= g CR ( x )
b ), known as the cubic B-spline
filter and plotted in Figure 19.9, is shown in Chapter 22 to be
b
b
1
1
6 ( 3
|
|
3
|
|
2 + 4 ) ,
≤|
|≤
x
6
x
0
x
1
b 3 ( x )=
1
1 ) 3 + 3 (
1 ) 2
6 (
(
|
x
|−
|
x
|−
3 (
|
x
|−
1 )+ 1 ) ,1
≤|
x
|≤
2
0, otherwise
(19.10)
There is a slight difference from the function in Chapter 22, however: This chap-
ter's version of b 3 has support [
0
2
1
0
1
2
2, 2 ] , while in Chapter 22 the support is [ 0, 4 ] .
x
1 )= 3 . This means that when we recon-
struct an image using b 3 , the reconstructed value at the image points is not the
original image value, but a blend between it and its two neighbors.
Notice that b 3 ( 0 )= 3 , while b 3 (
±
Figure 19.10: The Catmull-Rom
spline filter.
An alternative is the Catmull-Rom spline (see Chapter 22 for details),
γ CR ,
which is zero at every integer except
γ CR ( 0 )= 1, as shown in Figure 19.10.
This means that reconstructing with this filter leaves the image points unchanged,
and merely interpolates values between them. On the other hand, the Catmull-
Rom spline takes on negative values, which means that interpolating with it may
produce negative results, which is a problem: We can't have “blacker than black”
values. The formula for the Catmull-Rom spline is
y = f M ( x )
1
) 3 + 4 ( 1
) 2 +( 1
3 ( 1
−|
x
|
−|
x
|
−|
x
|
) ,
1
x
1
γ CR ( x )= 1
2
0
) 3
) 2 ,
( 2
−|
x
|
( 2
−|
x
|
1
≤|
x
|≤
2
(19.11)
0,
otherwise
2
1
0
1
2
A 3
1
3 blend of the Catmull-Rom curve and the B-spline curve was recom-
mended by Mitchell and Netravali [MN88] as the best all-around cubic to use
for image reconstruction and resampling. That filter (shown in Figure 19.11) is
given by
x
Figure
19.11:
The
Mitchell-
Netravali filter.
 
 
 
Search WWH ::




Custom Search