Introduction to Digital Image Processing with MATLAB Asia
Introduction to Digital Image Processing with MATLAB® Asia Edition Mc. Andrew‧Wang‧Tseng Chapter 6: Image Geometry 1 © 2010 Cengage Learning Engineering. All Rights Reserved. 1
6. 1 Interpolation of Data • Suppose we have a collection of four values that we wish to enlarge to eight 2 Ch 6 -p. 121 -122 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 1 Interpolation of Data x x' 3 Ch 6 -p. 122 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 1 Interpolation of Data • The a and b of the linear function can be solved by • Then we can obtain the linear function (continuous) 4 Ch 6 -p. 122 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 1 Interpolation of Data • In digital (discrete), none of the points coincide exactly with an original xj, except for the first and last • We have to estimate function values on the known values of nearby f (xj) based • Such estimation of function values based on surrounding values is called interpolation 5 Ch 6 -p. 122 -123 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 4 • Nearest-neighbor interpolation 6 Ch 6 -p. 123 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 5 • Linear interpolation 7 Ch 6 -p. 123 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 6 (Equation 6. 1) 8 Ch 6 -p. 124 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 2 Image Interpolation • Using the formula given by Equation 6. 1 9 Ch 6 -p. 125 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 7 10 Ch 6 -p. 125 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 8 bilinear interpolation 11 Ch 6 -p. 126 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 2 Image Interpolation • Function imresize • Where A is an image of any type, k is a scaling factor, and ’method’ is either ’nearest’ or ’bilinear’, etc. 12 Ch 6 -p. 127 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 9 & 6. 10 13 Ch 6 -p. 127 -128 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 3 General Interpolation (Equation 6. 2) 14 Ch 6 -p. 129 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 12 15 Ch 6 -p. 129 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 3 General Interpolation • The functions R 0(u) and R 1(u) are just two members of a family of possible interpolation functions • Another such function provides cubic interpolation 16 Ch 6 -p. 130 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 14 17 Ch 6 -p. 131 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 15 18 Ch 6 -p. 131 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 16 19 Ch 6 -p. 131 -132 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 4 Enlargement by Spatial Filtering • If we merely wish to enlarge an image by a power of two, there is a quick and dirty method that uses linear filtering e. g. ü zero-interleaved 20 Ch 6 -p. 132 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 17 This can be implemented with a simple function 21 Ch 6 -p. 133 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 4 Enlargement by Spatial Filtering We can now replace the zeros by applying a spatial filter to this matrix nearest-neighbor 22 Ch 6 -p. 133 bilinear © 2010 Cengage Learning Engineering. All Rights Reserved. bicubic
6. 4 Enlargement by Spatial Filtering 23 Ch 6 -p. 134 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 18 24 Ch 6 -p. 134 -135 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 5 Scaling Smaller • Making an image smaller is also called image minimization • Subsampling e. g. 25 Ch 6 -p. 135 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 19 26 Ch 6 -p. 136 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 6 Rotation 27 Ch 6 -p. 136 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 21 28 Ch 6 -p. 138 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 6 Rotation • In Figure 6. 21, the filled circles indicate the original position, and the open circles point their positions after rotation • We must ensure that even after rotation, the points remain in that grid • To do this we consider a rectangle that includes the rotated image, as shown in Figure 6. 22 29 Ch 6 -p. 137 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 22 30 Ch 6 -p. 138 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 23 31 Ch 6 -p. 138 © 2010 Cengage Learning Engineering. All Rights Reserved.
6. 6 Rotation The gray value at (x”, y”) can be found by interpolation, using surrounding gray values. This value is then the gray value for the pixel at (x’, y’) in the rotated image 32 Ch 6 -p. 137 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 24 33 Ch 6 -p. 139 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 25 34 Ch 6 -p. 139 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 26 35 Ch 6 -p. 140 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 27 36 Ch 6 -p. 141 © 2010 Cengage Learning Engineering. All Rights Reserved.
FIGURE 6. 28 37 Ch 6 -p. 142 © 2010 Cengage Learning Engineering. All Rights Reserved.
- Slides: 37