Till Point Processing2023 WM

Download as pdf or txt
Download as pdf or txt
You are on page 1of 91

IMAGING

Film photography

Time consuming

Real time processing was not possible

No automation based on vision


Digital photography

Images are stored by capturing the binary data using


some electronic devices (SENSORS)

Sensors: Charge Coupled Device (CCD)


Complementary metal–oxide–semiconductor (CMOS)
Photo multiplier tube (PMT)
The CCD was invented in 1969 by Willard Boyle and
George Smith at AT&T Bell Labs.
Nobel Prize in Physics in 2010 !!!!!!
A simple image formation method
IMAGE is defined by a two dimensional function f(x,y)

where f(x,y) is the intensity or the gray level values


of the image at the spatial coordinates x,y.

When x, y and f are discrete, the image is called DIGITAL image

A DIGITAL image is composed of finite number of


elements (say 256x256) each of which has a
particular location and values. These elements are
called picture element, or image element or pels
or pixels
The value or the amplitude of “f” at the spatial

coordinate (x,y) is a positive scalar quantity whose

physical meaning is determined by the source of

the image.

Pixel values (f) is proportional to energy radiated by


the physical source.

So, 0  f ( x, y)  ∞
f(x,y) depends on
1. amount of illumination of the source on the object (i(x,y))

2. amount of illumination reflected from the object (r(x,y))

 f ( x, y)  i ( x, y ) r ( x, y )  l

where 0  i( x, y)  
and l = gray level of the monochrome image
0  r ( x, y)  1

Lmin  l  Lmax where Lmin  iminrmin


Lmax  imaxrmax

So, Lmin  0
Lmax  L  1 ( say )
The interval [0, L  1] is defined as GRAYSCALE

l  0  black
l  L  1  white

8-bit grayscale  [0,28  1]  [0,255]


f=0 f = L-1
16 gray levels , hence 4 bit image
An image may be continuous with respect to the

x- and y- and also in the amplitude.

 Digitization of coordinate value is called


SAMPLING.

 Digitization of amplitude value is called


QUANTIZATION.
Sampling depends on arrangement of sensors
to generate the image
Representing Digital Images :

The result of sampling and quantization yields the

image in form of a matrix of real numbers.

x, y vary from 0,1….. and are not the actual value of the physical coordinate
The number of bits (b) required to store a digitized image is

b  M  N k

For 8-bit image, k = 8

Gray level = [0,255]

L = 28

b=MxNx8
Spatial and gray level resolution

Spatial resolution :

Spatial resolution is the smallest distinguishable detail


in an image.

It depends on sampling.
w
w
Spatial
resolution of
google earth
~ 65 cm
A B A B A B A B

Line pairs : AA and BB


Distance between the line pairs = 2w
1
No. of lines per unit length =
2w
Spatial resolution = no. of distinguishable lines/length
1
Hence, spatial resolution =
2w
Typical effects of varying the number of samples in a
digital image

(Pixel size = constant,


and gray level = 256)

Sub-sampling
Sub-sampled image is scaled to the original one
Gray level resolution :

Refers to the smallest distinguishable change in the

gray level.

Gray level resolution is highly subjective and it

depends on the hardware utilized to capture the image.


8 7
2 2

6
2 2 5
4
2 2 3

2 1
2 2
• Enhancement is needed for better representation

and extraction of important information.

• Methods of enhancement is highly subjective.


Eagle Nebula, Hubble Telescope

Raw image (1) from Hubble Tel. Raw image (2) from Hubble Tel.
Processed Image of Eagle Nebula
Image enhancement approach

Two categories

Spatial domain method Frequency domain method


Spatial domain method::
Spatial domain refers to the image plane and

the method implies the direct manipulation

of the pixels in the image.

Frequency domain method

Modifying the pixels in the Fourier transformed

image of the original image.


Spatial domain process :

g( x , y )  T [ f ( x , y )]

where f ( x , y )  Original image

g( x , y )  Processed image

T  Transformation function or Operator


Point Processing

The simplest form of T is when neighborhood size is

1 x 1 (i.e., point processing)

g( x , y )  T [ f ( x , y )]
 s  T (r )
where s  g( x , y )
r  f ( x, y)
T is the gray level transformation function
Gray level transformation for contrast enhancement
Basic transformation functions for image enhancement
1. Linear (negative and identity transformation)

2. Logarithmic (log and inverse-log transformation)

3. Power law (nth and nth root power transformation)


Image identity 

sr
Image negative 

s  L 1 r
For 8-bit image ; s  255  r
Log transformation 

s  c log(1  r )
Where c = constant; r0
Power law transformation 


s  cr

where

c &  are positive constants


 correction Dark levels have to be stretched

1
 correction Dark levels have to be compressed

>1
Piecewise linear transformation function
Gray level slicing

Use to HIGHLIGHT a specific range of gray levels

which are often desired in an image


Bit plane slicing

Inner pixel gray levels can be explored

by doing bit plane slicing


Histogram Processing

The histogram of a digital image with gray levels

in the range [0,L-1] is a discrete function

h( rk )  nk

where rk = kth gray level


nk = number of pixels in the image
having gray level value rk
Normalization:

h( rk ) nk
p( rk )  
n n

n = total number of pixels in the image

p( rk ) = probability of occurrence of gray level


rk

 p(r )  1
k
k
p(rk) =h(rk)/n

rk = 255

 p(r )  1
k
k
Uniformly distributed
histogram yields

HIGH CONTRAST IMAGE

Hence, histogram
processing requires the
stretching of gray level
uniformly over the entire
gray level range.

This is histogram equalization


Histogram

p(r)

r =1
Histogram equalization

p(s)

s
0 1
1. Requires the distribution of histogram peaks
uniformly over the entire gray level range

2. Equalize the height of the peaks

Let us define the gray level values (r) to be

• Continuous and

• Normalized between [0,1]


r0 Black

r 1 White

For any r, the transformation

s  T (r ) ; 0  r  1
Let us require that the transformation
function T(r) should satisfy

1. T(r) is single valued and monotonically


increasing in the interval 0 ≤ r ≤ 1

2. 0 ≤ T(r) ≤ 1 for 0 ≤ r ≤ 1
s
T(r)  Single valued
and
monotonically increasing
r
s T(r)  Not single valued

Inverse transformation of the T(r) will not


give the original image
Non-monotonic transformation function

T(r)
s

r
Transformation Transformation
from black  white from white  black
Hence the requirements:
1. T(r) should be single valued which ensures the

inverse transformation will exists

The monotonicity condition preserves the

increasing order from black to white in the

output image

2. Condition (b) guarantees the output gray levels

will be in the same range as that of input range


The gray levels (r or s) in an image

random variable in the interval [0,1]

pr ( r ) & ps ( s ) are the PDFs of random


variables r and s, respectively

From the PDF theory of the random variable:

ps ( s ) ds  pr ( r ) dr
To make the histogram uniform:

Put, ps ( s )  1

 ds  pr ( r ) dr
s r

 ds   p ( ) d
0 0
r

r
s   p ( ) d  T (r )
0
r
r
s  T (r )  
0
pr ( ) d

Hence, the transformation function (T(r)) is equal


to the CDF of random variable, r

a)T(r) is singled valued and monotonically


increasing function. Hence the first condition
is satisfied.

b) Values of T(r) or s lie in the range [0,1]


For discrete values,

nk
pr ( rk )  , k  0, 1, ..... L  1
n

k
sk  T ( rk )   p (r )
j 0
r j

k nj
sk  T ( rk )  n
j 0
, for k  0, 1, ...., L  1
This will do the histogram equalization
AUTOMATICALLY
Histogram matching for recognition process

Draw the output histogram, if

a)f(x,y)+g(x,y)
b)f(x,y)-g(x,y)
c) f(x,y) × g(x,y)
d)f(x,y) /g(x,y)
Recognition using histogram of a grayscale image

•Define 256 vectors corresponding to each grayscale values


•Define new vector taking mean of 9 consecutive such vectors
•Create the database
•Store the mean vector in the database
•Compare the result of input with the database and take the decision
Image averaging

Noisy image can be enhanced by averaging it

over a set of images

A noisy image (g(x,y)) can be expressed as

g( x , y )  f ( x , y )   ( x , y )
where
f ( x, y)  Original image

 ( x, y)  Noise

If the noise (x,y) is uncorrelated, then


•The expected value of the noise (x,y) = 0

•The expected covariance of the


two random variables = 0
{ g i ( x , y )}  Represents a set of noisy image

The average image is formed by,

K
1
g( x , y ) 
K
 g ( x, y)
i 1
i

1  K K

  
K  i 1
fi  
i 1
i 

Take expectation either side

1  K K

E( g)   
K  i 1
E( fi )  
i 1
E ( i )

f i is a constant and same for all the images

 E{ f i }  f i

&
E { i }  0

 E{ g( x, y )}  f ( x, y )
K=8 K=16

K=64 K=128
Scaling of the gray levels during mathematical
operation

+ =

unscaled scaled
-

unscaled
=
scaled

You might also like