Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that...

20
Image Geometry Digital Image Processing

Transcript of Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that...

Page 1: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

Image GeometryDigital Image Processing

Page 2: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

2

Interpolation of DataSuppose we have a collection of four values that we

wish to enlarge to eight:

Interpolated results x-axis => y-axis

Note that none of both counterparts exactly coincide, except for the first and last. Therefore, an estimation (i.e., interpolation) function is needed for all mapped values.

or

Page 3: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

3

Interpolation of Data

• The a and b of the linear function can be solved by

• Then we can obtain the linear function

Page 4: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

4

Popular Linear Interpolation Methods

Nearest-neighbor interpolation Linear interpolation

Page 5: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

5

Calculation of Linear Interpolation

Ch6-p.124

f(x1), F, f(x2) are co-linear

Page 6: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

6

Image InterpolationConsider a 4x4

image is enlarged to an 8x8 image

Only the corner pixels are aligned

Interplation is needed

Page 7: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

7

Bilinear Interpolation

Page 8: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

8

Image Resize – imresize()• Function imresize

• Where A is an image of any type, k is a scaling factor, and ’method’ is either ’nearest’ or ’bilinear’, etc.

Ch6-p.127

Page 9: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

9

General Interpolation

Ch6-p.129

Page 10: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

10

Cubic Interpolation

Page 11: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

11

Bi-cubic Interpolation

Ch6-p.131

Page 12: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

12

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 filteringWe may expand the image size and fill the interleaved

rows and columns with 0s. e.g.

Replace the interleaved 0s with interpolated values by either nearest-neighbor, bilinear, bi-cubic interpolation methods.

Ch6-p.132

Page 13: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

Enlargement Example (1/4)Create a 4x4 matrix (later expanded to 8x8)

The 8x8 zero-interleaved matrix can be obtained by:

13

Page 14: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

14

Enlargement Example (2/4)The enlarged 8x8 matrix

The interpolation methods could be either

nearest-neighbor bilinear bicubic

Ch6-p.133

Page 15: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

15

Enlargement Example (3/4)Nearest-neighbor

Bilinear

Ch6-p.134

Page 16: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

16

Enlargement Example (4/4)Bi-cubic

Page 17: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

17

Scaling Smaller• Making an image smaller is also called image

minimization• Subsampling example

Nearest-neighbor minimization

Bi-cubic interpolation for minimization

Drawing a circle (points away from (512,512) approximately 256 pixels are considered on the circle)

Default: nearest neighbor

Bi-cubic minimization

Page 18: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

18

Rotation

• The filled circles indicate the original position, and the open circles point their positions after rotation• Issues:• Ensure points are on the grid after rotation• Points in the rotated image need to be

interpolated

Page 19: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

19

Rotate with nearest-neighbor interpolation

Rotate with bi-cubic interpolation

Page 20: Digital Image Processing. 2 Interpolation of Data Suppose we have a collection of four values that we wish to enlarge to eight: Interpolated results x-axis.

20

Anamorphosis – morphing

The Ambassadors (1533) by Hans Holbein