You are on page 1of 55

Digital Image

Fundamentals
Key Stages in Digital Image
Processing
Image Morphologica
Restoration l Processing

Image
Segmentation
Enhancement

Image Object
Acquisition Recognition

Representatio
Problem Domain n&
Description
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing:
Image Aquisition
Image Morphologica
Restoration l Processing

Image Segmentatio
Enhancement n

Image Object
Acquisition Recognition

Representatio
Problem Domain n&
Description
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing:
Image Enhancement
Image Morphologica
Restoration l Processing

Image Segmentatio
Enhancement n

Image Object
Acquisition Recognition

Representatio
Problem Domain n&
Description
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing:
Image Restoration
Image Morphologica
Restoration l Processing

Image Segmentatio
Enhancement n

Image Object
Acquisition Recognition

Representatio
Problem Domain n&
Description
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing:
Morphological Processing
Image Morphologica
Restoration l Processing

Image Segmentatio
Enhancement n

Image Object
Acquisition Recognition

Representatio
Problem Domain n&
Description
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing:
Segmentation
Image Morphologica
Restoration l Processing

Image Segmentatio
Enhancement n

Image Object
Acquisition Recognition

Representatio
Problem Domain n&
Description
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing:
Object Recognition
Image Morphologica
Restoration l Processing

Image Segmentatio
Enhancement n

Image Object
Acquisition Recognition

Representatio
Problem Domain n&
Description
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing:
Representation & Description
Image Morphologica
Restoration l Processing

Image Segmentatio
Enhancement n

Image Object
Acquisition Recognition

Representatio
Problem Domain n&
Description
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing:
Image Compression
Image Morphologica
Restoration l Processing

Image Segmentatio
Enhancement n

Image Object
Acquisition Recognition

Representatio
Problem Domain n&
Description
Colour Image Image
Processing Compression
Key Stages in Digital Image Processing:
Colour Image Processing
Image Morphologica
Restoration l Processing

Image Segmentatio
Enhancement n

Image Object
Acquisition Recognition

Representatio
Problem Domain n&
Description
Colour Image Image
Processing Compression
Elements of Visual Perception

Structure of the human eye


Rods and cones in the retina
Image formation in the eye
Perceived brightness
Image Sensing and Acquisition
A simple image formation model
Illumination and reflectance
Illumination and transmissivity

f ( x, y )  i ( x, y ) r ( x, y )
Image Sampling and Quantization
Sampling and quantization
Representing digital images
Saturation and noise
Spatial and gray-level resolution
Subsampled and resampled
Reducing spatial resolution
Varying the number of gray levels
N and k in different-details images
Zooming and shrinking
Some Basic Relationships Between
Pixels
 Neighbors of a pixel
◦ Horizontal and vertical neighbors.
 (x+1, y), (x-1, y), (x, y+1), (x, y-1)
◦ Four diagonal neighbors: ND(p)
 (x+1, y+1), (x+1, y-1), (x-1, y+1), (x-1, y-1)
◦ 4-neighbors of p: N4(p).
◦ 8-neighbors of p: N8(p).
 N8(p) = N4(p) ∪ ND(p)
 Adjacency
 Connectivity
 Regions
 Boundary
Adjacency

p
 p

8-adjacency: N4(p)
 4- ∪ND(p)
Nadjacency:
4(p)

N4(p)
 4-adjacency: if q is in the set N4(p).
 8-adjacency: if q is in the set N8(p).
 m-adjacency: if
– if q is in the set N4(p), or
– if q is in the set ND(p) and the set N4(p)∩N4(q) has
no pixels whose values are from V.
m-Adjacency
 A mixed adjacency combines 4- and 8-
adjacency to avoid the ambigities.

Multiple 8- m-adjacency
adjacency
Two pixels p and q are m-adjacent if
(i) q is in N4(p) or,
(ii)q is in ND(p) and N4(p)∩ N4(q) has no pixel.
 Path:
◦ (x0, y0), (x1, y1), …, (xn, yn) where (xi, yi) and (xi+1,
yi+1) are adjacent.
◦ Closed path: (xn, yn) = (x0, y0)
 Connectivity:
◦ Two pixels are said connected if they have the same value
and there is a path between them.
◦ If a S is a set of pixels,
 For any pixel p in S, the set of pixels that are connected to it is
called a connected component of S.
 If S has only one connected component, S is called a connected
set.
Regions
 R is a region if R is a connected set.
 The pixel in the boundary (contour) has at

least one 4-adjacent neighbor whose value is


0.
2
 Distance measures 2 1 2
◦ Euclidean distance 2 1 0 1 2
◦ City-block distance or D4 distance. 2 1 2
D4(p, q)= |x - s | + |y - t | 2
◦ D8 distance or chessboard distance.
D8(p, q)= max (|x - s |, | y - t |) 2 2 2 2 2
2 1 1 1 2
2 1 0 1 2
2 1 1 1 2
2 2 2 2 2
Basic Principle
 (x,y)  (x’,y’) is a geometric transformation
 We are given pixel values at (x,y) and want to

interpolate the unknown values at (x’,y’)


 Usually (x’,y’) are not integers and therefore

we can use linear interpolation to guess their


values

MATLAB implementation: z’=interp2(x,y,z,x’,y’,method);

41
Rotation
y
y’

x’
θ
x

 x'  cos sin    x 


 y'   sin  cos   y 
  

42
MATLAB Example
z=imread('cameraman.tif');
% original coordinates
[x,y]=meshgrid(1:256,1:256);

% new coordinates
a=2;
for i=1:256;for j=1:256;
x1(i,j)=a*x(i,j);
y1(i,j=y(i,j)/a;
end;end
% Do the interpolation
z1=interp2(x,y,z,x1,y1,'cubic');
EE465: Introduction to Digital
Image Processing 43
Rotation Example

θ=3o

44
Scale

a=1/2

 x' a 0   x 
 y '   0 1 / a   y 
    

45
Affine Transform

square parallelogram
 x'  a11 a12   x   d x 
 y '  a     
   21 a22   y  d y 

EE465: Introduction to Digital


Image Processing 46
Affine Transform Example

 x' .5 1   x  0


 y '  .5  2  y   1
      

47
Shear

square parallelogram

 x' 1 0  x   d x 
 y '   s 1  y   d 
      y 

EE465: Introduction to Digital


Image Processing 48
Shear Example

 x '   1 0   x  0 
 y '  .5 1  y   1
      

EE465: Introduction to Digital


Image Processing 49
Arithmetic Image Operations
(blending)
 Two source images can be added, multiplied, one
subtracted from the other or one divided by the other
to produce a single destination (other types are also
discussed later)
 These operations are known as image arithmetic or

image blending.
 Each of these methods is a point processing operation

where corresponding samples from the two source


images are arithmetically combined to generate the
output.
 These operations are not single-source operations!

50
Arithmetic Image Operations
(blending)

 Define image addition (with rescaling). Given source


images Ia and Ib of dimensions maxna and mbxnb then
image addition is given by equation where x ranges
over [0, min(ma, mb)] and y ranges over [0, min(na,
nb)].

51
Example of Image Addition

52
Image Subtraction
 Image subtraction is useful for visualizing the difference between two
images.
◦ One way of telling whether two images are identical is to subtract one
from the other and if the maximum sample value of the result is zero
then the images are identical.
 Example: A source image is equalized in intensity. The equalized image is
subtracted from the source to highlight areas of change.
Image Subtraction:
 We may have to adjust the gray-scale of the subtracted
image to be [0, 255] (if 8-bit is used).

 First, find the minimum and the maximum gray value


of the subtracted image.

 Set the minimum value to be 0 and the maximum to be


255 while the rest are adjusted according to the interval
[0,255], by timing each value with 255/max.

 Subtraction is also used in segmentation of moving


pictures to track the changes after subtract the
sequenced images, what is left should be the moving
elements in the image, plus noise

54
Image multiplication
 Consider multiplying a full color source with an image having only white and
black.
◦ The binary image is known as a mask where the white pixels pass the source
image to the output while the black pixels erase the corresponding source
images pixels.
◦ Multiplication is a good technique for either adding color to a line drawing or
for emphasizing edges in a full color image.
◦ In part (a) of this figure, a source image is multiplied by the mask of (b) to
obtain the output of (c). Many image processing applications use image
multiplication to create artistic filters for digital artists.

You might also like