0% found this document useful (0 votes)
35 views

ECE 468 / CS 519: Digital Image Processing Interpolation, Intensity Transforms

This document summarizes key concepts in digital image processing including spatial image transformations like translation, scaling, rotation, and complex affine transformations. It discusses image interpolation techniques like bilinear and bicubic interpolation. It also covers intensity transformations of images such as shading correction, masking, rescaling intensity values, image negatives, contrast stretching, and gamma correction. Spatial transforms are used to geometrically alter images while intensity transforms modify pixel intensities.

Uploaded by

Kien Pham
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

ECE 468 / CS 519: Digital Image Processing Interpolation, Intensity Transforms

This document summarizes key concepts in digital image processing including spatial image transformations like translation, scaling, rotation, and complex affine transformations. It discusses image interpolation techniques like bilinear and bicubic interpolation. It also covers intensity transformations of images such as shading correction, masking, rescaling intensity values, image negatives, contrast stretching, and gamma correction. Spatial transforms are used to geometrically alter images while intensity transforms modify pixel intensities.

Uploaded by

Kien Pham
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 29

ECE 468 / CS 519:

Digital Image Processing

Interpolation, Intensity Transforms

Prof. Sinisa Todorovic

[email protected]
Spatial Image Transformations

Affine transforms:

• Translation

• Scaling

• Rotation

• Shear
Example

(x , y ) = T {(x, y)}
⇥ ⇥
x x
⇤ y ⌅=T⇤ y ⌅ homogeneous
coordinates
1 1
2D Translation


x
=
y displacement

tx
t=
ty homogeneous
coordinates
⇤ ⌅
⇥ ⇥ x
x + tx 1 0 tx ⇧
P =P +t= = y ⌃
y + ty 0 1 ty
1
⇥ ⇥ ⇥
x + tx 1 0 tx x
P ⇤ y + ty ⌅ = ⇤ 0 1 ty ⌅⇤ y ⌅
1 0 0 1 1


translation matrix
source: S. Savarese
2D Scaling


sx x
=
sy y


x
=
y

⇥ S ⇥ ⇥
sx x sx 0 0 x
⇧ ⌃ ⇧ ⌃⇧ ⌃
⇤ sy y ⌅ = ⇤ 0 sy 0 ⌅⇤ y ⌅
1 0 0 1 1

scaling matrix source: S. Savarese


Complex Affine: First Scaling and then Translation

Is the ordering important?

P =S·P
P = (T · S) · P
P =T ·P
⇥ ⇥ ⇥ ⇥
x 1 0 tx sx 0 0 x
⇧ ⌃ ⇧ ⌃⇧ ⌃⇧ ⌃
⇤ y ⌅ = ⇤ 0 1 ty ⌅ ⇤ 0 sy 0 ⌅⇤ y ⌅
1 0 0 1 0 0 1 1

sx 0 tx
⇧ ⌃ scaling + translation
A=⇤ 0 sy ty ⌅ matrix
0 0 1 source: S. Savarese
2D Rotation

counter-clockwise
by angle ⇥
cos x sin y
P =
y sin x + cos y

y x
P =
y
x x

⇥ R ⇥ ⇥
x cos sin 0 x
⇧ ⌃ ⇧ ⌃⇧ ⌃
⇤ y ⌅ = ⇤ sin cos 0 ⌅⇤ y ⌅
1 0 0 1 1


rotation matrix
source: S. Savarese
Complex: First Scaling, Then Rotation, Finally Translation

t R S






translation rotation scaling


matrix matrix matrix

⇤ ⌅ ⇤ ⌅
x ⇥ x
⌥ RS t ⌥
⇧ y ⌃= ⇧ y ⌃
0 1
1 1
Estimating the Spatial Transform

transformed
input
input

inverse estimation
transform error
MATLAB Example

>>img=imread(image_name); %input image


>>tform = maketform(’affine’,T); % set transform



>>img_out = imtransform(img, tform, interp);

>>imshow(img_out)
Image Interpolation

original resampling shrinking zooming


Image Interpolation
Bilinear Interpolation

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

coefficients that need to be estimated


Bilinear Interpolation

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

coefficients that need to be estimated

?
Bilinear Interpolation

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

coefficients that need to be estimated

nearest neighbor
Bilinear Interpolation

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

coefficients that need to be estimated

?
Bilinear Interpolation

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

coefficients that need to be estimated

nearest neighbor
Bilinear Interpolation

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

1 2 coefficients that need to be estimated

?
4 3

nearest neighbor
Bilinear Interpolation

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

1 2 coefficients that need to be estimated

? ax1 + by1 + cx1 y1 + d = f (x1 , y1 )


4 3
ax2 + by2 + cx2 y2 + d = f (x2 , y2 )
ax3 + by3 + cx3 y3 + d = f (x3 , y3 )
ax4 + by4 + cx4 y4 + d = f (x4 , y4 )
nearest neighbor

a, b, c, d
Example: Zooming-in

nearest neighbor bilinear


Image Interpolation

• Bilinear N = 1

• Bicubic N = 3

N N
f (x, y) = i j
aij x y
i=0 j=0

new locations new locations

estimated from the known neighboring locations


Intensity Transformations of Images

g(x, y) = T {f (x, y)}

transformed input
input
Example: Shading Correction

g(x, y) = f (x, y)h(x, y)

input shading profile f(x,y)/shading


Example: Masking

g(x, y) = f (x, y)h(x, y)

input mask f(x,y) * mask


Rescaling Intensity Values

f (x, y) min[f (x, y)]


g(x, y) = K
max[f (x, y)] min[f (x, y)]

input output
Image Negatives

g(x, y) = L 1 f (x, y)
Contrast Stretching
input

output thresholded
Gamma Correction

s = cr
Example: Gamma Correction

input γ=.6 input γ=3

γ=.4 γ=.3 γ=4 γ=5

You might also like