23
Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Embed Size (px)

Citation preview

Page 1: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Arithmetic and Geometric Transformations (Chapter 2)

CS474/674 – Prof. Bebis

Page 2: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Addition

• Useful for combining information between two images:

0 <= α <= 1

Page 3: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Averaging (see Example 2.5 on page 75)

• Image quality can be improved by averaging a number of images together (very useful in astronomy applications).

5 10

20 50 100

Note: images must be registered!

Page 4: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Subtraction

• Useful for “change” detection.

Page 5: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Subtraction (cont’d)

• Medical application

(iodine medium injectedinto the bloodstream)

difference enhanced

Page 6: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Geometric Transformations

• Transformation applied on the coordinates of the pixels (i.e., relocate pixels).

• A geometric transformation has the general form

(x,y) = T{(v,w)}

where (v,w) are the original pixel coordinates and

(x,y) are the transformed pixel coordinates.

Page 7: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Geometric Transformations

1

0

0

]1[]1[

3231

2221

1211

tt

tt

tt

wvyx

affine transformation

y=v sinθ + w cosθ

Page 8: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Forward mapping

• Transformed pixel coordinates might not lie within the bounds of the image.

• Transformed pixel coordinates can be non-integer.

• There might be no pixels in the input image that map to certain pixel locations in the transformed image

No one-to-one

correspondence!

Page 9: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Forward mapping (cont’)

• An example of holes due to image rotation, implemented using the forward transformation.

Page 10: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Inverse Mapping

• To guarantee that a value is generated for every pixel in the output image, we must consider each output pixel in turn and use the inverse mapping to determine the position in the input image.

• To assign intensity values to these locations, we need to use some form of intensity interpolation.

Page 11: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

• Interpolation — process of using known data to estimate unknown values.

• Interpolation can be used to increase (or decrease) the number of pixels in a digital image.

e.g., some digital cameras use interpolation to produce a larger image than the sensor captured or to create digital zoom

http://www.dpreview.com/learn/?/key=interpolation

Interpolation

Page 12: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Interpolation (cont’d)

Zero-order interpolation: nearest-neighbor

Page 13: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Interpolation (cont’d)

First-order interpolation: average

Page 14: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Interpolation (cont’d)

Bilinear interpolation

I(x,y) = ax + by + cxy + d

The 4 unknowns (a,b,c,d) can be determined from 4 equations formed by the 4 nearest neighbors.

Page 15: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Interpolation (cont’d)

Bilinear interpolation

http://en.wikipedia.org/wiki/Bilinear_interpolation

Page 16: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Interpolation (cont’d)

Bicubic interpolation

• It involves the sixteen nearest neighbors of a point (i.e., 4x4 window).

• The 16 unknowns aij can be determined from sixteen equations formed by the 16 nearest neighbors.

j

i j

iij yxayxI

3

0

3

0

),(

Page 17: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Examples: Interpolation

Page 18: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Examples: Interpolation

Page 19: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Examples: Interpolation

Page 20: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Examples: Interpolation

Page 21: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Image Registration

• Goal: align two or more images of the same scene.

• How: estimate a transformation that aligns the two images.

Page 22: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Image Registration (cont’d)

• Under certain assumptions, an affine transformation can be used to align two images.

• There are 6 unknowns (i.e., t11, t12, t21, t22, t31, t32)

• We need at least 6 equations.

• Three correspondences are enough, more are better.

1

0

0

]1[]1[

3231

2221

1211

tt

tt

tt

wvyxUnknowns?Equations?Correspondences?

Page 23: Arithmetic and Geometric Transformations (Chapter 2) CS474/674 – Prof. Bebis

Image Registration Example

apply affinetransformation

Error when comparing the transformed and originalimages.