Image Processing Reference
In-Depth Information
for
( y_output
=
0;
y_output
< Image_Height_Output ;
y_output++)
{
for
( x_output
=
0;
x_output
< Image_Width_Output ;
x_output++)
{
x_input
=
1/Sx
x_output ;
y_output ;
g( x_output , y_output )
y_input
=
1/Sy
=
f ( x_input , y_input );
}
}
where Sx and Sy are the scale factors and (x ,y ) is written as (x_output,y_output)
and (x,y) is written as (x_input,y_input).
10.2.2 Interpolation
As can be seen in Fig. 10.2 backward mapping is very likely to result in a value of
(x, y) which is not possible. For example, what is the intensity value of f( 3 . 4 , 7 . 9 ) ?
It is undefined and we therefore interpolate in order to find an appropriate intensity
value. The most simple form of interpolation is called zeroth-order interpolation .
It rounds off to the value of the nearest possible pixel, i.e., f( 3 . 4 , 7 . 9 )
f( 3 , 8 ) .
A better, but also more computational demanding, approach is to apply first-order
interpolation (a.k.a. bilinear interpolation), which weights the intensity values of the
four nearest pixels according to how close they are. The principle is illustrated in
Fig. 10.4 . The area of the square wherein (x, y) is located is 1. Now imagine that
we use the position (x, y) to divide this square into four sub-regions. The area of
each of these sub-regions define the weight of one of the four nearest pixels. That is,
the area dx
·
dy becomes the weight for the pixel f(x 1 ,y 1 ) and so forth. The final
intensity value is then found as
g(x ,y )
=
f(x 0 ,y 0 )
·
( 1
dx)( 1
dy)
+ f(x 1 ,y 0 ) · (dx)( 1
dy)
+ f(x 0 ,y 1 ) · ( 1
dx)(dy)
+ f(x 1 ,y 1 ) · (dx · dy)
(10.11)
Note that this equation can be rewritten more compactly for an efficient software
implementation. Note also that more advanced methods for interpolation exist, but
this is beyond the scope of this text.
Search WWH ::




Custom Search