0% found this document useful (0 votes)
50 views26 pages

Ivp2 - Image Fundamentals

The document discusses fundamentals of digital images, including: 1) A simple image model defines an image as a 2D light intensity function, where the intensity values at each spatial coordinate (pixel) represent illumination and reflectance. 2) Images can be represented as 2D arrays for processing, with each array element (pixel) storing an intensity value. 3) Image resolution is defined by the number of pixels, with higher resolutions providing more detail but larger file sizes. 4) 2D convolution and correlation operations are described for image filtering and feature detection using matrix methods.

Uploaded by

ramadevi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views26 pages

Ivp2 - Image Fundamentals

The document discusses fundamentals of digital images, including: 1) A simple image model defines an image as a 2D light intensity function, where the intensity values at each spatial coordinate (pixel) represent illumination and reflectance. 2) Images can be represented as 2D arrays for processing, with each array element (pixel) storing an intensity value. 3) Image resolution is defined by the number of pixels, with higher resolutions providing more detail but larger file sizes. 4) 2D convolution and correlation operations are described for image filtering and feature detection using matrix methods.

Uploaded by

ramadevi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 26

IMAGE FUNDAMENTALS

A Simple Image Model


 Image refers to a two dimensional light intensity function
denoted by f(x,y) - x and y denote the spatial co-ordinates.
The magnitude of f( ) at spatial co-ordinates (x,y) gives the
intensity of image at that point.

 f(x,y) can be characterized by two components.

 The amount of source light being incident on the scene being viewed –
illumination component (i(x,y)).

 The amount of light reflected by the objects in the scene – reflectance


component (r(x,y)).
Cont..
 f(x,y) = i(x,y) r(x,y)
 0 < i(x,y) < ∞
 0 < r(x,y) < 1

 f(x,y) can be treated as an MxN array for


processing, where M and N are the dimension of
the image along X and Y directions.

 Each element of the array represents the intensity


values and can be called as pixel or pel.
Image Resolution
 Resolution:
 Image Resolution = the dpi (dots per inch = pixels per
inch) of an image.
Cont..
 Common image resolutions are 72, 200, 300, etc.
 The higher the resolution, the higher the print
quality and the larger the data size of the image (in
kilobytes or megabytes)
 The resolution of a digital image is defined as the
number of pixels it contains. A 5 megapixel image is
typically 2,560 pixels wide and 1,920 pixels high
and has a resolution of 4,915,200 pixels, rounded off
to 5 million pixels.
2-D Function Representation
2-D Function Representation

2
2 3 2

2
2D function – Examples.
n2

A unit Step sequence u(n1, n2)

n1
n2

A unit impulse δ(n1, n2)


n1
2D function – Examples.
n2

Line impulse δT(n1)

n1
Separable Functions
 A 2-D sequence x(n1,n2) is said to be a
separable sequence if it can be expressed as

 x(n1, n2) = f(n1) g(n2)

 δ (n1, n2) = δ(n1) δ(n2).


 U(n1, n2) = u(n1) u(n2).
Two Dimensional Systems
 Linear System:
 Let x(m,n) and y(m,n) represent the input and output of a
two dimensional system,
 y(m,n) = T [x(m,n)]
 The system is linear iff any linear combination of two
inputs x1(m,n) and x2(m,n) produces the combination of
their respective outputs y1(m,n) and y2(m,n) for arbitrary
constants a1 and a2.
 T[a1 x1(m,n) + a2 x2(m,n)] = a1T[x1(m,n)] + a2T[ x2(m,n)]
 = a1 y1(m,n) + a2 y2(m,n)
Cont.

 Shift Invariant System:


 The system is spatially invariant or shift invariant
if a translation of input causes the same
translation of the output.

 If y(m,n) = T [x(m,n)]
 y(m-i,n-j) = T [x(m-i,n-j)]
2-D Convolution
 The 2D discrete convolution equation is

M 1 N 1
C (i, j )   A(k , l ) B(i  k , j  l )
k 0 l 0
Steps for 2-D convolution
 Either of the array is rotated by 180 degree. (say B
(k, l))

 Then shifted by (i, j) and overlayed on the other


array (A (k, l))

 Sum the product of arrays in the overlapping


regions gives the result at (i, j).
Convolution - Illustration
2-D Convolution - Example
Matrix Method
 If F and G are the input arrays of size m1 x n1 and
m2 x n2 resp.
 Pad both the matrices with zeros to bring them to a
size M x N
 M ≥ m1 + m2 -1
 N ≥ n1 + n2 -1
 Form an MN x 1 column vector fp from matrix F by
row stacking.
 Form a similar matrix Gp from G matrix.
 From an MN x MN circulant matrix from the rows
of Gp.
Matrix Method Cont..
 The circulant matrix formed is called a block
circulant matrix, Gb, which can be written as

[G1 ][G N ]........[G2 ]


 
[G
 2 1][G ].........[G ]
3 
Gb  . . . 
 
 . . . 
[G ][G ]....[G ] 
 N N 1 1 

 Each N x N block matrix is formed from the ith row


of Gp
Example – 2D Convolution
1 2 0   1 1 0
1 2   1 1
F  G  f p  3 4 0 g p   2 2 0
3 4   2 2 0 0 0  0 0 0

 1 0 1 0 0 0 2 0 2 1 
 1 1 0 0 0 0 2  2 0   2
   
0 1 1 0 0 0 0 2  2 0
   
  2 0 2  1 0 1 0 0 0   3
Gb   2  2 0 0 Y = G b * fp ’
1 1 0 0 0 f p '   4
   
 0 2  2 0 1  1 0 0 0  0
0 0 0 2 0 2 1 0 1 0
   
0 0 0 2 2 0 1 1 0  0
   
 0 0 0 0 2  2 0 1  1  0
Example – 2D Convolution
1 
 1 0 0 0 0 2 2 0 1  2
 1 1 0   
 0 0 0 2  2 0  0
0 1 1 0 0 0 0 2  2  
   3
  2 0 1  1 0 0 0 0 2  f p '   4
Gb '   2  2 0 1 1 0 0 0 0  
  0
0 2 2 0 1 1 0 0 0 0
0  
0 2 2 0 1 1 0 0 0
 
0 0 0 2 2 0 1 1 0   
  0
 0 0 0 0 2  2 0 1  1 

Y = Gb ’ * fp ’
Circular convolution
 If two 1-D convolving sequences are periodic then
their convolution is also periodic and can be
represented as
N 1
y ( n)   x ( k ) h( n  k ) 0  n  N 1
k 0

 h(n)=h(N-n) and N-period


Cont..
 Example:
 N=4, h(n) = n+3(modulo 4)

 h(n) = [3 0 1 2] x(n) = [x(0) x(1) x(2) x(3)]

 y(0) = 3*x(0) + 2*(x(1) + 1*x(2) + 0*x(3)


 y(1) = 0*x(0) + 3*(x(1) + 2*x(2) + 1*x(3)
 y(2) = 1*x(0) + 0*(x(1) + 3*x(2) + 2*x(3)
 y(3) = 2*x(0) + 1*(x(1) + 0*x(2) + 3*x(3)
Cont..

 y ( 0)   3 2 1 0   x ( 0) 
 y (1)  0 3 2 1   x(1) 
  y ( n)  H c x ( n)
 y ( 2)   1 0 3 2   x ( 2) 
    
 y ( 3)  2 1 0 3  x(3) 

Hc, can be obtained by arranging the row vector h(n)


column wise and then obtaining the remaining columns by
rotating the previous column by one.
Circular convolution – 2D
 The circular convolution in 2-D can be
implemented in using the same principles
using a block circulant matrix.
Separable Function an eg.
 1  1
h(n1 , n2 )   
 1 1 
 1
h2 (n2 )  1 1 h1 (n1 )   
1
 1  1  1
1 1  1   1 1 
   

h(0,0) = h1(0) x h2(0) = 1.1 = 1; h(0,1) = h1(1) x h2(0) = 1.-1 = -1


h(1,0) = h1(0) x h2(1) = 1.1 = 1; h(1,1) = h1(1) x h2(1) = 1.-1 = -1
2-D Correlation

 The 2D discrete correlation equation is

M 1 N 1
C (i, j )   A(k , l ) B (i  k , j  l )
k 0 l 0

You might also like