Académique Documents
Professionnel Documents
Culture Documents
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Simple
p Image
g Operation
p
We assume the image pixels as
elements of a set and use the set
operation to manipulate images
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Logical
g Operations
p on Images
g
We assume binary values for pixels of
the image (B/W) and treat the image as
a binary buffer.
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Image
g Operation
p
Most of image operation take
into account the adjacent
pixels when computing the
resulting values (for pixels).
Example: The value of a
pixel, in the resulting image,
is taken as the average of of
its adjacent neighbors.
Chapter 2
Digital Image Fundamentals
Geometric Spatial
p Transformation
These operations modify the spatial relationship
between pixels in an image.
In digital images Geometric Transformations
involves
1. Spatial Transformation of coordinates.
2. Intensity interpolations.
The geometric coordinate could be expressed as
(xp, yp) = T{(up, vp) }, where
(up, up) are the coordinate of the pixel p before
applying the transformation T and (xp, yp) are the
coordinate of the pixel
pi el p before applying
appl ing T
It is often written as vector operations
( x p , y p ) [u p , v p ]T
Chapter 2
Digital Image Fundamentals
Translation
Alter the position of a
ppoint or an object
j in 2D space.
p
u (u , v)
1 0 dx
( x, y ) v
0 1 dy 1
Chapter 2
Digital Image Fundamentals
R t ti
Rotation
Rotate a pixel P(x, y) around
the origin by an angle .
Th results
The lt pixel
i l position
iti isi (u, v)
P(x,y)
x u cos( ) v sin( )
y u sin( ) v cos( ) ( x, y)
R (u, v) (u cos( ) v sin( ), u sin( ) v cos( ))
x cos(( ) sin(
i ( ) u
y sin( ) cos( ) v
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Image Scale
Scale a region of pixels by a ( x, y)
factor ( s x , s y )
Each pixel in this region P(u,
P(u v) is
scaled to a new position is
P(x,y)
x u sx (u, v)
y u sy
The scale of include additional
( x, y) (u sx , v s y ) translation when no point of the
scaled region is in the origin
x S x 0 u
y 0 S y v
Chapter 2
Digital Image Fundamentals
S2,2
22
S2,1
Chapter 2
Digital Image Fundamentals
I
Image Sh
Sheer
(x, y)
Scale a region of pixels by a factor
(Shx,Shy).
Each pixel in this region P(u,
P(u v) is
Sheered to a new position is
P(x, y)
x u v shx (x y)
(x,
y v u shy
( x, y) (u v shx , v u shy )
Chapter 2
Digital Image Fundamentals
Horizontal Sheer
Chapter 2
Digital Image Fundamentals
H
Homogenous Coordinates
C di t
Let us consider applying several transformation T0, T1,, Tk on the same image.
u
Tk {Tk 1{...{T1{T0 }}...}} This requires k matrix multiplication for each pixel
v
If we can perform the following, where T= T0 T1 Tk , we are required to perform
one time k matrix multiplication and one matrix multiplication for each vertex
u u
T k T k 1 ...T1T0 T
v v
Chapter 2
Digital Image Fundamentals
Example:
Let us consider the following transformation
u
S 1, 2T5 , 3 R 30 S 7 , 5T 2 , 4
v
1 0 1 0 5 cos( 30 ) sin( 30 ) 7 0 1 0 2 u
0 2 0 1 3 sin( 30 ) cos( 30 ) 0 5 0 1 4 v
It is impossible
p to multiply
p y these matrices.
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Spatial
p Transformation
Scaling an image by
mapping each pixel to a
target.
In the resulting image
The number of pixels
increases
Some
S pixels
i l are empty
t
How to determine their
values?
Chapter 2
Digital Image Fundamentals
After Scaling
A better Result
Original
Image
Chapter 2
Digital Image Fundamentals
Spatial
p Transformation - Forward Scanningg
In this approach missing
Scale pixel are clearly visible.
+ To fill the missing pixel,
Rotate one couldld replicate
li t
pixels. However, the
quality of the resulting
is image
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Interpolation
According to Wikipedia
In the mathematical subfield of numerical analysis
analysis, interpolation is a
method of constructing new data points within the range of a discrete set of
known data points.
In Image Processing
It is a techniques to assign values to pixels in an images based on their
adjacent pixels, or adjacent samples that my not be correlate with pixel
location in the image.
image
Chapter 2
Digital Image Fundamentals
Value Interpolation
Let us assume we have several f f
0 3
samples of a function f f f f
1 2 k
f0, f1, f2,,fn
f f
N
Nearest
t (Z
(Zero Order)
Od ) 0 f 3
1
f f
2 k
f f
Bilinear (First Order) 0 f f
3
1 2
f
k
Chapter 2
Digital Image Fundamentals
Bili
Bilinear Interpolation
I t l ti
1D t
Length = 1 C i (1 t ) C a tC b
Ca Ci Cb
2D Length = 1
w
Ctl
Ctr C t (1 w )C tl wC tr
Lenngth = 1
Ct
C b (1 w )C bl wC br
h Cwh C wh (1 h )C b hC t
Cbl Cb Cbr
19922008 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 2
Digital Image Fundamentals
Q d i and
Quadric d Cubic
C bi IInterpolation
t l ti
Chapter 2
Digital Image Fundamentals
Q d i and
Quadric d Cubic
C bi IInterpolation
t l ti
The value of the sample position
f(x+dx,
( yy+dy)
y) is determined based
on the following equation.
2 2
f ( x dx, y dy ) f (x i, y j )Ca (dx i )Ca (dy j )
i 1 j 1
(a 2) | x |3 (a 3) | x |2 1 , 0 | x | 1
Ca ( x) a | x |3 5a | x |2 8a | x | 4a , 1 | x | 2
0 , 2 | x |
Chapter 2
Digital Image Fundamentals
1D Quadric Interpolation
Xi- f
3
General Quadric Equation 1 X Xi f
y ax bx c 2
i
+1
k
Using the three points to determine
p
the equation
q pparameters
yi 1 ax 2 i 1 bxi 1 c
After determining the parameters of
yi ax i bxi c
2
the quadric function, we plug in xp to
determine its value, yp
yi 1 ax 2 i 1 bxi 1 c
Similarly we can derive the 1D cubic interpolation of a point xp,p But we need
four points.
Chapter 2
Digital Image Fundamentals
2D Cubic Interpolation
(x,y)
f ( x, y ) C x ( x ) * C y ( y )
C x ( x) a x x 3 bx x 2 c x x d x
C y ( y ) a y y 3 by y 2 c y y d y
ax a y a x by ax c y a x d y a0 , 0 a0,1 a0 , 2 a0 , 3
b a bx by bx c y bx d y a1, 0 a1,1 a1, 2 a1,3
x y
cx a y c x by cx c y c x d y a2 , 0 a2,1 a2 , 2 a2 , 3
d x a y d x by d xcy d x d y a3,0 a3,1 a3,1 a3,1
We need to determine the value of the 16 parameters to compute the value of (xp,
xp) But we need four points.
19922008 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com
Chapter 2
Digital Image Fundamentals
Chapter 2
Digital Image Fundamentals
Visual Examples
BiLinear
Original
g Image
g
Nearest
BiCubic