digital image processing. 2 interpolation of data suppose we have a collection of four values that...

Post on 18-Dec-2015

217 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Image GeometryDigital Image Processing

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

3

Interpolation of Data

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

• Then we can obtain the linear function

4

Popular Linear Interpolation Methods

Nearest-neighbor interpolation Linear interpolation

5

Calculation of Linear Interpolation

Ch6-p.124

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

6

Image InterpolationConsider a 4x4

image is enlarged to an 8x8 image

Only the corner pixels are aligned

Interplation is needed

7

Bilinear Interpolation

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

9

General Interpolation

Ch6-p.129

10

Cubic Interpolation

11

Bi-cubic Interpolation

Ch6-p.131

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

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

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

13

14

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

The interpolation methods could be either

nearest-neighbor bilinear bicubic

Ch6-p.133

15

Enlargement Example (3/4)Nearest-neighbor

Bilinear

Ch6-p.134

16

Enlargement Example (4/4)Bi-cubic

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

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

19

Rotate with nearest-neighbor interpolation

Rotate with bi-cubic interpolation

20

Anamorphosis – morphing

The Ambassadors (1533) by Hans Holbein

top related