Chapter 6: Image Geometry 6.1 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight The a and b of the linear function can be solved by Then we can obtain the linear function (continuous)
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 based on the known values of nearby f (xj) Such estimation of function values based on surrounding values is called interpolation Nearest-neighbor interpolation
FIGURE 6.5 Linear interpolation (Equation 6.1)
6.2 Image Interpolation Using the formula given by Equation 6.1 bilinear interpolation
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.
FIGURE 6.9 & 6.10
6.3 General Interpolation Generalized interpolation function: R0(u) Nearest-neighbor interpolation (Equation 6.2)
6.3 General Interpolation R1(u) Linear interpolation Cubic interpolation
FIGURE 6.14
FIGURE 6.15
FIGURE 6.16
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
FIGURE 6.17 This can be implemented with a simple function
6.4 Enlargement by Spatial Filtering We can now replace the zeros by applying a spatial filter to this matrix nearest-neighbor bilinear bicubic
6.4 Enlargement by Spatial Filtering
FIGURE 6.18
6.5 Scaling Smaller Making an image smaller is also called image minimization Subsampling e.g.
FIGURE 6.19
6.6 Rotation
FIGURE 6.21
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
FIGURE 6.22
FIGURE 6.23
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
FIGURE 6.25
6.7 Anamorphosis
FIGURE 6.27
FIGURE 6.28