Vous êtes sur la page 1sur 57

Digital Image Processing, 3rd ed.

Gonzalez & Woods


www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

The Cornea is a tough,


g , transparent
p tissue
that covers the anterior surface of the eye.
The Sclera is an opaque membrane that
encloses the remainder of the optic globe
The Choroid contrarians the blood vessels,
which are the major source of nutrition to
the eye.
The lens is made up of concentric layer of
fibers cells and is supported
pp by
y fibers that
attach to the ciliary body.
The Retina lines the inside of the walls
entire posterior portion. Its surface include
two classes of light receptors: cones and rods.
The cones lies on the fovea and highly sensitive
to color (6-7 million in each eye).
The rods (75-150 million), which are distributed
over the retinal surface and serves to give general
overall picture of the field of view and are sensitive
to low level illumination.

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

The human eye can adapt to enormous range of light


intensity levels on the order of 1010 . The subjective
brightness (the intensity perceived by the eye) of the
eye is a logarithmic function.
t i vision
Photopic
Ph i i isi the
th vision
i i off the
th eye under
d well-lit
ll lit
conditions. In humans and many other animals, photopic
vision allows color perception, mediated by cone cells.
Scotopic vision is the vision of the eye under low light
conditions
conditions.

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

Simple Image Operation


Negating a binary image is done simply by exchanging the white pixels 1 by back
pixels 0 and vise versa. For gray scale images this is done by subtracting 255 from
the intensity of each pixel; i.e., Ci=255- Ci

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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.

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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.

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

Translation
Alter the position of a
ppoint or an object
j in 2D space.
p

( x, y ) Tdx ,dy (u , v) (u dx, v dy ) (u dx, v dy )

u (u , v)
1 0 dx
( x, y ) v
0 1 dy 1

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

Rotation around the


center of the image
by 250

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

S2,2
22

S2,1

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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 )

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

Horizontal Sheer

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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.

To overcome this limitation we use a homogeneous coordinate (x, y, w), where


w =1. This also update all the spatial transformation to 33 matrices.

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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?

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

After Scaling

A better Result
Original
Image

After Scaling with


Nearest Pixel

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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

Mapping the image of the


square pixel covers all the
pixels in the target image.
The value of a pixel is
determined by the mapped
squares that cover it.
it

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

Spatial Transformation - Backward Scanning


In this approach we fill the target image pixel by pixel. For each pixel we compute it
source position. The value of the target pixel is computed by interpolating the pixels
around the source pposition.

This approach does not


need to take into account
T-1
the type of transformation
Inverse
to determine the adjacent
Transformation
pixels of the source
position

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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

Bicubic (Third Order) f f


0 3
f f f
1 2 k
19922008 R. C. Gonzalez & R. E. Woods
Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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

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
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 |

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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.

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

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

Approximating Cubic Interpolation

19922008 R. C. Gonzalez & R. E. Woods


Digital Image Processing, 3rd ed.
Gonzalez & Woods
www.ImageProcessingPlace.com

Chapter 2
Digital Image Fundamentals

Visual Examples
BiLinear

Original
g Image
g

Nearest
BiCubic

19922008 R. C. Gonzalez & R. E. Woods

Vous aimerez peut-être aussi