SlideShare a Scribd company logo
1 of 77
 Image representation
 Image statistics
 Histograms (frequency)
 Entropy (information)
 Filters (low, high, edge, smooth)
The Course
 Books
Computer Vision –
Adrian Lowe
Digital Image Processing –
Gonzalez, Woods
Image Processing, Analysis
and Machine Vision – Milan
Sonka, Roger Boyle
Digital Image Processing
 Human vision - perceive and understand world
 Computer vision, Image Understanding / Interpretation,
Image processing.
3D world -> sensors (TV cameras) -> 2D images
Dimension reduction -> loss of information
 low level image processing
transform of one image to another
 high level image understanding
knowledge based - imitate human cognition
make decisions according to information in image
Introduction to Digital Image
Processing
HIGH
MEDIUM
LOW
Algorithm
Complexity
Increases
Classification / decision
Raw data
Amount of
Data
Decreases
 Acquisition,
preprocessing
 no intelligence
 Extraction, edge
joining
 Recognition,
interpretation
 intelligent
Low level digital image
processing
 Low level computer vision ~ digital image processing
 Image Acquisition
 image captured by a sensor (TV camera) and digitized
 Preprocessing
 suppresses noise (image pre-processing)
 enhances some object features - relevant to understanding the image
 edge extraction, smoothing, thresholding etc.
 Image segmentation
 separate objects from the image background
 colour segmentation, region growing, edge linking etc
 Object description and classification
 after segmentation
Signals and Functions
 What is an image
 Signal = function (variable with physical meaning)
one-dimensional (e.g. dependent on time)
two-dimensional (e.g. images dependent on two co-ordinates in a
plane)
three-dimensional (e.g. describing an object in space)
higher-dimensional
 Scalar functions
sufficient to describe a monochromatic image - intensity images
 Vector functions
represent color images - three component colors
Image Functions
 Image - continuous function of a number of variables
 Co-ordinates x, y in a spatial plane
 for image sequences - variable (time) t
 Image function value = brightness at image points
 other physical quantities
 temperature, pressure distribution, distance from the observer
 Image on the human eye retina / TV camera sensor - intrinsically 2D
 2D image using brightness points = intensity image
 Mapping 3D real world -> 2D image
 2D intensity image = perspective projection of the 3D scene
 information lost - transformation is not one-to-one
 geometric problem - information recovery
 understanding brightness info
Image Acquisition &
Manipulation
 Analogue camera
 frame grabber
 video capture card
 Digital camera / video recorder
 Capture rate  30 frames / second
 HVS persistence of vision
 Computer, digitised image, software (usually c)
 f(x,y)  #define M 128
#define N 128
unsigned char f[N][M]
 2D array of size N*M
 Each element contains an intensity value
Image definition
 Image definition:
A 2D function obtained by sensing a scene
F(x,y), F(x1,x2), F(x)
F- intensity, grey level
x,y - spatial co-ordinates
 No. of grey levels, L = 2B
 B = no. of bits
B L Description
1 2 Binary Image (black and white)
6 54 64 levels, limit of human visual system
8 256 Typical grey level resolution
f(N-1,M-1)
f(o,o)
N
M
Brightness and 2D images
 Brightness dependent several factors
 object surface reflectance properties
surface material, microstructure and marking
 illumination properties
 object surface orientation with respect to a viewer and light source
 Some Scientific / technical disciplines work with 2D images directly
 image of flat specimen viewed by a microscope with transparent
illumination
 character drawn on a sheet of paper
 image of a fingerprint
Monochromatic images
 Image processing - static images - time t is constant
 Monochromatic static image - continuous image
function f(x,y)
arguments - two co-ordinates (x,y)
 Digital image functions - represented by matrices
co-ordinates = integer numbers
Cartesian (horizontal x axis, vertical y axis)
OR (row, column) matrices
 Monochromatic image function range
lowest value - black
highest value - white
 Limited brightness values = gray levels
Chromatic images
Colour
Represented by vector not scalar
Red, Green, Blue (RGB)
Hue, Saturation, Value (HSV)
luminance, chrominance (Yuv , Luv)
Red
Green
Hue degrees:
Red, 0 deg
Green 120 deg
Blue 240 deg
Green
V=0
S=0
Use of colour space
Image quality
Quality of digital image proportional to:
spatial resolution
proximity of image samples in image plane
spectral resolution
bandwidth of light frequencies captured by sensor
radiometric resolution
number of distinguishable gray levels
time resolution
interval between time samples at which images captured
Image summary
 F(xi,yj)
 i = 0 --> N-1
 j = 0 --> M-1
 N*M = spatial resolution, size of image
 L = intensity levels, grey levels
 B = no. of bits
f(N-1,M-1)
f(o,o)
N
M
Digital Image Storage
Stored in two parts
header
width, height … cookie.
• Cookie is an indicator of what type of image file
data
uncompressed, compressed, ascii, binary.
File types
JPEG, BMP, PPM.
PPM, Portable Pixel Map
Cookie
Px
Where x is:
1 - (ascii) binary image (black & white, 0 & 1)
2 - (ascii) grey-scale image (monochromic)
3 - (ascii) colour (RGB)
4 - (binary) binary image
5 - (binary) grey-scale image (monochromatic)
6 - (binary) colour (RGB)
PPM example
 PPM colour file RGB
P3
# feep.ppm
4 4
15
0 0 0 0 0 0 0 0 0 15 0 15
0 0 0 0 15 7 0 0 0 0 0 0
0 0 0 0 0 0 0 15 7 0 0 0
15 0 15 0 0 0 0 0 0 0 0 0
Image statistics
 MEAN  =
 VARIANCE 2 =
 STANDARDEVIATION  =
M
N
y
x
f
M
y
N
x
*
)
,
(
1
0
1
0





M
N
y
x
f
M
y
N
x
*
)
)
,
(
(
1
0
1
0
2





 
iance
var
Histograms, h(l)
 Counts the number of occurrences of each grey level in
an image
 l = 0,1,2,… L-1
 l = grey level, intensity level
 L = maximum grey level, typically 256
 Area under histogram
 Total number of pixels N*M
unimodal, bimodal, multi-modal, dark, light, low contrast, high
contrast



MAX
l
l
h
0
)
(
Probability Density
Functions, p(l)
 Limits 0 < p(l) < 1
 p(l) = h(l) / n
 n = N*M (total number of pixels)
 1
)
(
0



MAX
l
l
p
Histogram Equalisation, E(l)
Increases dynamic range of an image
Enhances contrast of image to cover all possible
grey levels
Ideal histogram = flat
 same no. of pixels at each grey level
Ideal no. of pixels at each grey level =
L
M
N
i
*

Histogram equalisation
Typical histogram Ideal histogram
E(l) Algorithm
 Allocate pixel with lowest grey level in old image to 0 in new image
 If new grey level 0 has less than ideal no. of pixels, allocate pixels
at next lowest grey level in old image also to grey level 0 in new
image
 When grey level 0 in new image has > ideal no. of pixels move up
to next grey level and use same algorithm
 Start with any unallocated pixels that have the lowest grey level in
the old image
 If earlier allocation of pixels already gives grey level 0 in new image
TWICE its fair share of pixels, it means it has also used up its
quota for grey level 1 in new image
 Therefore, ignore new grey level one and start at grey level 2 …..
Simplified Formula
 E(l)  equalised function
 max  maximum dynamic range
 round  round to the nearest integer (up or down)
 L  no. of grey levels
 N*M  size of image
 t(l)  accumulated frequencies
)
1
))
(
*
)
*
((
,
max(
)
( 
 l
t
M
N
L
round
o
l
E
Histogram equalisation
examples
Typical histogram After histogram equalisation
Histogram Equalisation e.g.
0
1
2
3
4
5
6
7
8
9
10
1 2 3 4 5 6 7 8 9 10
Ideal=3
Before HE After HE
)
1
))
(
*
)
*
((
,
max(
)
( 
 l
t
M
N
L
round
o
l
E
g h(g) t(g) e(g) New hist
1 1 1 1 0
2 9 10 3 0
3 8 18 6 9
4 6 24 8 0
5 1 25 8 0
6 1 26 9 8
7 1 27 9 0
8 1 28 9 7
9 2 30 10 3
10 0 30 10 2
0
1
2
Noise in images
 Images often degraded by random noise
 image capture, transmission, processing
 dependent or independent of image content
 White noise - constant power spectrum
 intensity does not decrease with increasing frequency
 very crude approximation of image noise
 Gaussian noise
 good approximation of practical noise
 Gaussian curve = probability density of random variable
 1D Gaussian noise - µ is the mean
  is the standard deviation
Gaussian noise e.g.
50% Gaussian noise
Types of noise
 Image transmission
noise usually independent image signal
 additive, noise v and image signal g are independent
 multiplicative, noise is a function of signal magnitude
 impulse noise (saturated = salt and pepper noise)
Data Information
 Different quantities of data used to represent same
information
people who babble, succinct
 Redundancy
if a representation contains data that is not necessary
 Compression ratio CR =

 Relative data redundancy RD =
Same information Amounts of data
Representation 1 N1
Representation 2 N2
2
1
N
N
R
C
1
1
Types of redundancy
Coding
if grey levels of image are coded in such away that
uses more symbols than is necessary
Inter-pixel
can guess the value of any pixel from its neighbours
Psyco-visual
some information is less important than other info in
normal visual processing
Data compression
when one / all forms of redundancy are reduced / removed
data is the means by which information is conveyed
Coding redundancy
 Can use histograms to construct codes
 Variable length coding reduces bits and gets rid of redundancy
 Less bits to represent level with high probability
 More bits to represent level with low probability
 Takes advantage of probability of events
 Images made of regular shaped objects / predictable shape
 Objects larger than pixel elements
 Therefore certain grey levels are more probable than others
 i.e. histograms are NON-UNIFORM
 Natural binary coding assigns same bits to all grey levels
 Coding redundancy not minimised
Run length coding (RLC)
 Represents strings of symbols in an image matrix
 FAX machines
 records only areas that belong to the object in the image
 area represented as a list of lists
 Image row described by a sublist
 first element = row number
 subsequent terms are co-ordinate pairs
 first element of a pair is the beginning of a run
 second is the end
 can have several sequences in each row
 Also used in multiple brightness images
 in sublist, sequence brightness also recorded
Example of RLC
Inter-pixel redundancy, IPR
 Correlation between pixels is not used in coding
 Correlation due to geometry and structure
 Value of any pixel can be predicted from the value of the neighbours
 Information carried by one pixel is small
 Take 2D visual information
 transformed  NONVISUAL format
 This is called a MAPPING
 A REVERSIBLE MAPPING allows original to be reconstructed after
MAPPING
 Use run-length coding
 Due to properties of human eye
 Eye does not respond with equal sensitivity to all visual
information (e.g. RGB)
 Certain information has less relative importance
 If eliminated, quality of image is relatively unaffected
 This is because HVS only sensitive to 64 levels
 Use fidelity criteria to assess loss of information
Psyco-visual redundancy, PVR
Fidelity Criteria
 In a noiseless channel, the
encoder is used to remove any
redundancy
 2 types of encoding
 LOSSLESS
 LOSSY
 Design concerns
 Compression ratio, CR achieved
 Quality achieved
 Trade off between CR and quality
Info
Source
Encoder Channel Decoder Info User
Sink
NOISE
PVR removed, image quality is
reduced
2 classes of criteria
OBJECTIVE fidelity criteria
SUBJECTIVE fidelity criteria
OBJECTIVE: if loss is expressed
as a function of IP / OP
Fidelity Criteria
 Input  f(x,y)
 compressed output  f(x,y)
 error  e(x,y) = f(x,y) -f(x,y)
 erms = root mean squared error
 SNR = signal to noise ratio
 PSNR = peak signal to noise ratio
M
N
y
x
e
e
M
y
N
x
rms
*
)
,
(
1
0
1
0
2
















 1
0
1
0
2
1
0
1
0
2
)
,
(
)
,
(
M
y
N
x
M
y
N
x
ms
y
x
e
y
x
f
SNR






 1
0
1
0
2
2
)
,
(
)
1
(
*
*
M
y
N
x
y
x
e
L
M
N
PSNR
Information Theory
How few data are needed to represent an
image without loss of info?
Measuring information
random event, E
probability, p(E)
units of information, I(E)
I(E) = self information of E
amount of info is inversely proportional to the probability
base of log is the unit of info
log2 = binary or bits
e.g. p(E) = ½ => 1 bit of information (black and white)
)
(
log
)
(
1
log
)
( E
p
E
p
E
I 


Infromation channel
 Connects source and user
physical medium
 Source generates random symbols from a closed set
 Each source symbol has a probability of occurrence
 Source output is a discrete random variable
 Set of source symbols is the source alphabet
Info
Source
Encoder Channel Decoder Info User
Sink
NOISE
Entropy
 Entropy is the uncertainty of the source
 Probability of source emitting a symbol, S = p(S)
 Self information I(S) = -log p(S)
 For many Si , i = 0, 1, 2, … L-1
 Defines the average amount of info obtained by
observing a single source output
 OR average information per source output (bits)
alphabet = 26 letters  4.7 bits/letter
typical grey scale = 256 levels  8 bits/pixel





1
0
2 )
(
log
L
i
i
i P
P
H
Filters
 Need templates and convolution
 Elementary image filters are used
enhance certain features
de-enhance others
edge detect
smooth out noise
discover shapes in images
 Convolution of Images
 essential for image processing
 template is an array of values
 placed step by step over image
 each element placement of
template is associated with a
pixel in the image
 can be centre OR top left of
template
Template Convolution
 Each element is multiplied with its corresponding
grey level pixel in the image
 The sum of the results across the whole template is
regarded as a pixel grey level in the new image
 CONVOLUTION --> shift add and multiply
 Computationally expensive
big templates, big images, big time!
 M*M image, N*N template = M2N2
Convolution
 Let T(x,y) = (n*m) template
 Let I(X,,Y) = (N*M) image
 Convolving T and I gives:
 CROSS-CORRELATION not CONVOLUTION
 Real convolution is:
 convolution often used to mean cross-correlation










1
0
1
0
)
,
(
)
,
(
)
,
(
n
i
m
j
j
Y
i
X
I
j
i
T
Y
X
I
T










1
0
1
0
)
,
(
)
,
(
)
,
(
n
i
m
j
j
Y
i
X
I
j
i
T
Y
X
I
T
Templates
 Template is not allowed to shift
off end of image
 Result is therefore smaller than
image
 2 possibilities
 pixel placed in top left position of
new image
 pixel placed in centre of template
(if there is one)
 top left is easier to program
 Periodic Convolution
 wrap image around a ball
 template shifts off left, use
right pixels
 Aperiodic Convolution
 pad result with zeros
 Result
 same size as original
 easier to program
Template Image Result
1 0
0 1
1 1 3 3 4
1 1 4 4 3
2 1 3 3 3
1 1 1 4 4
2 5 7 6 *
2 4 7 7 *
3 2 7 7 *
* * * * *
Filters
 Need templates and convolution
 Elementary image filters are used
enhance certain features
de-enhance others
edge detect
smooth out noise
discover shapes in images
 Convolution of Images
 essential for image processing
 template is an array of values
 placed step by step over image
 each element placement of
template is associated with a
pixel in the image
 can be centre OR top left of
template
Template Convolution
 Each element is multiplied with its corresponding
grey level pixel in the image
 The sum of the results across the whole template is
regarded as a pixel grey level in the new image
 CONVOLUTION --> shift add and multiply
 Computationally expensive
big templates, big images, big time!
 M*M image, N*N template = M2N2
Templates
 Template is not allowed to shift
off end of image
 Result is therefore smaller than
image
 2 possibilities
 pixel placed in top left position of
new image
 pixel placed in centre of template
(if there is one)
 top left is easier to program
 Periodic Convolution
 wrap image around a ball
 template shifts off left, use
right pixels
 Aperiodic Convolution
 pad result with zeros
 Result
 same size as original
 easier to program
Template Image Result
1 0
0 1
1 1 3 3 4
1 1 4 4 3
2 1 3 3 3
1 1 1 4 4
2 5 7 6 *
2 4 7 7 *
3 2 7 7 *
* * * * *
Low pass filters
 Moving average of time series
smoothes
 Average (up/down, left/right)
smoothes out sudden changes in
pixel values
removes noise
introduces blurring
 Classical 3x3 template
Removes high frequency
components
Better filter, weights
centre pixel more
1 1 1
1 1 1
1 1 1
1 3 1
3 16 3
1 3 1
Example of Low Pass
Original Gaussian, sigma=3.0
High pass filters
 Removes gradual changes
between pixels
 enhances sudden changes
 i.e. edges
 Roberts Operators
 oldest operator
 easy to compute only 2x2
neighbourhood
 high sensitivity to noise
 few pixels used to calculate
gradient
1 0
0 -1
0 1
-1 0
High pass filters
 Laplacian Operator
 known as
 template sums to zero
 image is constant (no sudden
changes), output is zero
 popular for computing second
derivative
 gives gradient magnitude only
 usually a 3x3 matrix
 stress centre pixel more
 can respond doubly to some
edges
2
 0 1 0
1 -4 1
0 1 0
1 1 1
1 -8 1
1 1 1
2 -1 2
-1 -4 -1
2 -1 2
-1 2 -1
2 -4 2
-1 2 -1
Cont.
 Prewitt Operator
 similar to Sobel, Kirsch, Robinson
 approximates the first derivative
 gradient is estimated in eight
possible directions
 result with greatest magnitude is the
gradient direction
 operators that calculate 1st derivative
of image are known as COMPASS
OPERATORS
 they determine gradient direction
 1st 3 masks are shown below
(calculate others by rotation …)
 direction of gradient given by mask
with max response
1 1 1
0 0 0
-1 -1 -1
0 1 1
-1 0 1
-1 -1 0
-1 0 1
-1 0 1
-1 0 1
Cont.
Sobel
good horizontal / vertical
edge detector
Robinson
Kirsch
1 2 1
0 0 0
-1 -2 -1
0 1 2
-1 0 1
-2 -1 0
-1 0 1
-2 0 2
-1 0 1
1 1 1
1 -2 1
-1 -1 -1
3 3 3
3 0 3
-5 -5 -5
Example of High Pass
Laplacian Filter - 2nd derivative
More e.g.’s
Horizontal Sobel Vertical Sobel
1st derivative
Morphology
 The science of form and structure
the science of form, that of the outer form, inner structure,
and development of living organisms and their parts
about changing/counting regions/shapes
 Used to pre- or post-process images
via filtering, thinning and pruning
 Count regions (granules)
number of black regions
 Estimate size of regions
area calculations
 Smooth region edges
create line drawing of face
 Force shapes onto region
edges
curve into a square
Morphological Principles
 Easily visulaised on binary image
 Template created with known origin
 Template stepped over entire image
similar to correlation
 Dilation
if origin == 1 -> template unioned
resultant image is large than original
 Erosion
only if whole template matches image
origin = 1, result is smaller than original
1 *
1 1
Dilation
Dilation (Minkowski addition)
fills in valleys between spiky regions
increases geometrical area of object
objects are light (white in binary)
sets background pixels adjacent to object's
contour to object's value
smoothes small negative grey level regions
Dilation e.g.
Erosion
Erosion (Minkowski subtraction)
removes spiky edges
objects are light (white in binary)
decreases geometrical area of object
sets contour pixels of object to background value
smoothes small positive grey level regions
Erosion e.g.
Hough Transform
Intro
edge linking & edge relaxation join curves
require continuous path of edge pixels
HT doesn’t require connected / nearby points
Parametric representation
Finding straight lines
consider, single point (x,y)
infinite number of lines pass through (x,y)
each line = solution to equation
simplest equation:
y = kx + q
HT - parametric
representation
y = kx + q
(x,y) - co-ordinates
k - gradient
q - y intercept
Any stright line is characterised by k & q
use : ‘slope-intercept’ or (k,q) space not (x,y)
space
(k,q) - parameter space
(x,y) - image space
can use (k,q) co-ordinates to represent a line
Parameter space
q = y - kx
a set of values on a line in the (k,q) space ==
point passing through (x,y) in image space
OR
every point in image space (x,y) ==
line in parameter space
HT properties
 Original HT designed to detect straight lines and
curves
 Advantage - robustness of segmentation results
 segmentation not too sensitive to imperfect data or noise
 better than edge linking
 works through occlussion
 Any part of a straight line can be mapped into
parameter space
Accumulators
Each edge pixel (x,y) votes in (k,q) space for
each possible line through it
i.e. all combinations of k & q
This is called the accumulator
If position (k,q) in accumulator has n votes
n feature points lie on that line in image space
Large n in parameter space, more probable
that line exists in image space
Therefore, find max n in accumulator to find
lines
HT Algorithm
 Find all desired feature points in
image space
i.e. edge detect (low pass filter)
 Take each feature point
increment appropriate values in
parameter space
i.e. all values of (k,q) for give (x,y)
 Find maxima in accumulator array
 Map parameter space back into
image space to view results
Alternative line representation
 ‘slope-intercept’ space has problem
verticle lines k -> infinity
q -> infinity
 Therefore, use (,) space
 = xcos  + y sin 
 = magnitude
drop a perpendicular from origin to the line
 = angle perpendicular makes with x-axis
, space
In (k,q) space
point in image space == line in (k,q) space
In (,) space
point in image space == sinusoid in (,) space
where sinusoids overlap, accumulator = max
maxima still = lines in image space
 Practically, finding maxima in accumulator is non-
trivial
often smooth the accumulator for better results
HT for Circles
Extend HT to other shapes that can be
expressed parametrically
Circle, fixed radius r, centre (a,b)
(x1-a)2 + (x2-b)2 = r2
accumulator array must be 3D
unless circle radius, r is known
re-arrange equation so x1 is subject and x2 is the
variable
for every point on circle edge (x,y) plot range of
(x1,x2) for a given r
Hough circle example
General Hough Properties
Hough is a powerful tool for curve detection
Exponential growth of accumulator with
parameters
Curve parameters limit its use to few
parameters
Prior info of curves can reduce computation
e.g. use a fixed radius
Without using edge direction, all accumulator
cells A(a) have to be incremented
Optimisation HT
With edge direction
edge directions quantised into 8 possible directions
only 1/8 of circle need take part in accumulator
Using edge directions
a & b can be evaluated from
 = edge direction in pixel x
delta  = max anticipated edge direction error
 Also weight contributions to accumulator A(a) by edge
magnitude
General Hough
Find all desired points in image
For each feature point
for each pixel i on target boundary
get relative position of reference point from i
add this offset to position of i
increment that position in accumulator
Find local maxima in accumulator
Map maxima back to image to view
General Hough example
 explicitly list points on shape
 make table for all edge pixles for target
 for each pixel store its position relative to some
reference point on the shape
 ‘if I’m pixel i on the boundary, the reference point is at
ref[i]’

More Related Content

Similar to DIP.ppt

Fundamentals of image processing
Fundamentals of image processingFundamentals of image processing
Fundamentals of image processingRoufulAlamBhat1
 
03 digital image fundamentals DIP
03 digital image fundamentals DIP03 digital image fundamentals DIP
03 digital image fundamentals DIPbabak danyal
 
Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)Varun Ojha
 
الوسائط المتعددة Multimedia تاج
الوسائط المتعددة  Multimedia تاجالوسائط المتعددة  Multimedia تاج
الوسائط المتعددة Multimedia تاجmaaz hamed
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portionMoe Moe Myint
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slidesBHAGYAPRASADBUGGE
 
chap2.ppt is the presentation of image of eye.
chap2.ppt is the presentation of image of eye.chap2.ppt is the presentation of image of eye.
chap2.ppt is the presentation of image of eye.YogeshRotela
 
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...IJERD Editor
 
Why Image compression is Necessary?
Why Image compression is Necessary?Why Image compression is Necessary?
Why Image compression is Necessary?Prabhat Kumar
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfnagwaAboElenein
 
Histogram equalization
Histogram equalizationHistogram equalization
Histogram equalizationtreasure17
 
Lectures 1 3 final (4)
Lectures 1 3 final (4)Lectures 1 3 final (4)
Lectures 1 3 final (4)seemakashyap15
 
Image enhancement
Image enhancementImage enhancement
Image enhancementKuppusamy P
 
Notes on image processing
Notes on image processingNotes on image processing
Notes on image processingMohammed Kamel
 

Similar to DIP.ppt (20)

Ppt ---image processing
Ppt ---image processingPpt ---image processing
Ppt ---image processing
 
Fundamentals of image processing
Fundamentals of image processingFundamentals of image processing
Fundamentals of image processing
 
03 digital image fundamentals DIP
03 digital image fundamentals DIP03 digital image fundamentals DIP
03 digital image fundamentals DIP
 
h.pdf
h.pdfh.pdf
h.pdf
 
Seema dip
Seema dipSeema dip
Seema dip
 
Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)Chapter 1 introduction (Image Processing)
Chapter 1 introduction (Image Processing)
 
الوسائط المتعددة Multimedia تاج
الوسائط المتعددة  Multimedia تاجالوسائط المتعددة  Multimedia تاج
الوسائط المتعددة Multimedia تاج
 
Lect 03 - first portion
Lect 03 - first portionLect 03 - first portion
Lect 03 - first portion
 
3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides3 intensity transformations and spatial filtering slides
3 intensity transformations and spatial filtering slides
 
chap2.ppt is the presentation of image of eye.
chap2.ppt is the presentation of image of eye.chap2.ppt is the presentation of image of eye.
chap2.ppt is the presentation of image of eye.
 
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
IJERD (www.ijerd.com) International Journal of Engineering Research and Devel...
 
Chapter02.ppt
Chapter02.pptChapter02.ppt
Chapter02.ppt
 
ch1ip.ppt
ch1ip.pptch1ip.ppt
ch1ip.ppt
 
Why Image compression is Necessary?
Why Image compression is Necessary?Why Image compression is Necessary?
Why Image compression is Necessary?
 
Lec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdfLec_2_Digital Image Fundamentals.pdf
Lec_2_Digital Image Fundamentals.pdf
 
Histogram equalization
Histogram equalizationHistogram equalization
Histogram equalization
 
Lectures 1 3 final (4)
Lectures 1 3 final (4)Lectures 1 3 final (4)
Lectures 1 3 final (4)
 
Image compression .
Image compression .Image compression .
Image compression .
 
Image enhancement
Image enhancementImage enhancement
Image enhancement
 
Notes on image processing
Notes on image processingNotes on image processing
Notes on image processing
 

Recently uploaded

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAbhinavSharma374939
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINESIVASHANKAR N
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxAsutosh Ranjan
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 

Recently uploaded (20)

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
Analog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog ConverterAnalog to Digital and Digital to Analog Converter
Analog to Digital and Digital to Analog Converter
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINEMANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
MANUFACTURING PROCESS-II UNIT-2 LATHE MACHINE
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 
Coefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptxCoefficient of Thermal Expansion and their Importance.pptx
Coefficient of Thermal Expansion and their Importance.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 

DIP.ppt

  • 1.  Image representation  Image statistics  Histograms (frequency)  Entropy (information)  Filters (low, high, edge, smooth) The Course  Books Computer Vision – Adrian Lowe Digital Image Processing – Gonzalez, Woods Image Processing, Analysis and Machine Vision – Milan Sonka, Roger Boyle
  • 2. Digital Image Processing  Human vision - perceive and understand world  Computer vision, Image Understanding / Interpretation, Image processing. 3D world -> sensors (TV cameras) -> 2D images Dimension reduction -> loss of information  low level image processing transform of one image to another  high level image understanding knowledge based - imitate human cognition make decisions according to information in image
  • 3. Introduction to Digital Image Processing HIGH MEDIUM LOW Algorithm Complexity Increases Classification / decision Raw data Amount of Data Decreases  Acquisition, preprocessing  no intelligence  Extraction, edge joining  Recognition, interpretation  intelligent
  • 4. Low level digital image processing  Low level computer vision ~ digital image processing  Image Acquisition  image captured by a sensor (TV camera) and digitized  Preprocessing  suppresses noise (image pre-processing)  enhances some object features - relevant to understanding the image  edge extraction, smoothing, thresholding etc.  Image segmentation  separate objects from the image background  colour segmentation, region growing, edge linking etc  Object description and classification  after segmentation
  • 5. Signals and Functions  What is an image  Signal = function (variable with physical meaning) one-dimensional (e.g. dependent on time) two-dimensional (e.g. images dependent on two co-ordinates in a plane) three-dimensional (e.g. describing an object in space) higher-dimensional  Scalar functions sufficient to describe a monochromatic image - intensity images  Vector functions represent color images - three component colors
  • 6. Image Functions  Image - continuous function of a number of variables  Co-ordinates x, y in a spatial plane  for image sequences - variable (time) t  Image function value = brightness at image points  other physical quantities  temperature, pressure distribution, distance from the observer  Image on the human eye retina / TV camera sensor - intrinsically 2D  2D image using brightness points = intensity image  Mapping 3D real world -> 2D image  2D intensity image = perspective projection of the 3D scene  information lost - transformation is not one-to-one  geometric problem - information recovery  understanding brightness info
  • 7. Image Acquisition & Manipulation  Analogue camera  frame grabber  video capture card  Digital camera / video recorder  Capture rate  30 frames / second  HVS persistence of vision  Computer, digitised image, software (usually c)  f(x,y)  #define M 128 #define N 128 unsigned char f[N][M]  2D array of size N*M  Each element contains an intensity value
  • 8. Image definition  Image definition: A 2D function obtained by sensing a scene F(x,y), F(x1,x2), F(x) F- intensity, grey level x,y - spatial co-ordinates  No. of grey levels, L = 2B  B = no. of bits B L Description 1 2 Binary Image (black and white) 6 54 64 levels, limit of human visual system 8 256 Typical grey level resolution f(N-1,M-1) f(o,o) N M
  • 9. Brightness and 2D images  Brightness dependent several factors  object surface reflectance properties surface material, microstructure and marking  illumination properties  object surface orientation with respect to a viewer and light source  Some Scientific / technical disciplines work with 2D images directly  image of flat specimen viewed by a microscope with transparent illumination  character drawn on a sheet of paper  image of a fingerprint
  • 10. Monochromatic images  Image processing - static images - time t is constant  Monochromatic static image - continuous image function f(x,y) arguments - two co-ordinates (x,y)  Digital image functions - represented by matrices co-ordinates = integer numbers Cartesian (horizontal x axis, vertical y axis) OR (row, column) matrices  Monochromatic image function range lowest value - black highest value - white  Limited brightness values = gray levels
  • 11. Chromatic images Colour Represented by vector not scalar Red, Green, Blue (RGB) Hue, Saturation, Value (HSV) luminance, chrominance (Yuv , Luv) Red Green Hue degrees: Red, 0 deg Green 120 deg Blue 240 deg Green V=0 S=0
  • 12. Use of colour space
  • 13. Image quality Quality of digital image proportional to: spatial resolution proximity of image samples in image plane spectral resolution bandwidth of light frequencies captured by sensor radiometric resolution number of distinguishable gray levels time resolution interval between time samples at which images captured
  • 14. Image summary  F(xi,yj)  i = 0 --> N-1  j = 0 --> M-1  N*M = spatial resolution, size of image  L = intensity levels, grey levels  B = no. of bits f(N-1,M-1) f(o,o) N M
  • 15. Digital Image Storage Stored in two parts header width, height … cookie. • Cookie is an indicator of what type of image file data uncompressed, compressed, ascii, binary. File types JPEG, BMP, PPM.
  • 16. PPM, Portable Pixel Map Cookie Px Where x is: 1 - (ascii) binary image (black & white, 0 & 1) 2 - (ascii) grey-scale image (monochromic) 3 - (ascii) colour (RGB) 4 - (binary) binary image 5 - (binary) grey-scale image (monochromatic) 6 - (binary) colour (RGB)
  • 17. PPM example  PPM colour file RGB P3 # feep.ppm 4 4 15 0 0 0 0 0 0 0 0 0 15 0 15 0 0 0 0 15 7 0 0 0 0 0 0 0 0 0 0 0 0 0 15 7 0 0 0 15 0 15 0 0 0 0 0 0 0 0 0
  • 18. Image statistics  MEAN  =  VARIANCE 2 =  STANDARDEVIATION  = M N y x f M y N x * ) , ( 1 0 1 0      M N y x f M y N x * ) ) , ( ( 1 0 1 0 2        iance var
  • 19. Histograms, h(l)  Counts the number of occurrences of each grey level in an image  l = 0,1,2,… L-1  l = grey level, intensity level  L = maximum grey level, typically 256  Area under histogram  Total number of pixels N*M unimodal, bimodal, multi-modal, dark, light, low contrast, high contrast    MAX l l h 0 ) (
  • 20. Probability Density Functions, p(l)  Limits 0 < p(l) < 1  p(l) = h(l) / n  n = N*M (total number of pixels)  1 ) ( 0    MAX l l p
  • 21. Histogram Equalisation, E(l) Increases dynamic range of an image Enhances contrast of image to cover all possible grey levels Ideal histogram = flat  same no. of pixels at each grey level Ideal no. of pixels at each grey level = L M N i * 
  • 23. E(l) Algorithm  Allocate pixel with lowest grey level in old image to 0 in new image  If new grey level 0 has less than ideal no. of pixels, allocate pixels at next lowest grey level in old image also to grey level 0 in new image  When grey level 0 in new image has > ideal no. of pixels move up to next grey level and use same algorithm  Start with any unallocated pixels that have the lowest grey level in the old image  If earlier allocation of pixels already gives grey level 0 in new image TWICE its fair share of pixels, it means it has also used up its quota for grey level 1 in new image  Therefore, ignore new grey level one and start at grey level 2 …..
  • 24. Simplified Formula  E(l)  equalised function  max  maximum dynamic range  round  round to the nearest integer (up or down)  L  no. of grey levels  N*M  size of image  t(l)  accumulated frequencies ) 1 )) ( * ) * (( , max( ) (   l t M N L round o l E
  • 26. Histogram Equalisation e.g. 0 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 Ideal=3 Before HE After HE ) 1 )) ( * ) * (( , max( ) (   l t M N L round o l E
  • 27. g h(g) t(g) e(g) New hist 1 1 1 1 0 2 9 10 3 0 3 8 18 6 9 4 6 24 8 0 5 1 25 8 0 6 1 26 9 8 7 1 27 9 0 8 1 28 9 7 9 2 30 10 3 10 0 30 10 2 0 1 2
  • 28. Noise in images  Images often degraded by random noise  image capture, transmission, processing  dependent or independent of image content  White noise - constant power spectrum  intensity does not decrease with increasing frequency  very crude approximation of image noise  Gaussian noise  good approximation of practical noise  Gaussian curve = probability density of random variable  1D Gaussian noise - µ is the mean   is the standard deviation
  • 29. Gaussian noise e.g. 50% Gaussian noise
  • 30. Types of noise  Image transmission noise usually independent image signal  additive, noise v and image signal g are independent  multiplicative, noise is a function of signal magnitude  impulse noise (saturated = salt and pepper noise)
  • 31. Data Information  Different quantities of data used to represent same information people who babble, succinct  Redundancy if a representation contains data that is not necessary  Compression ratio CR =   Relative data redundancy RD = Same information Amounts of data Representation 1 N1 Representation 2 N2 2 1 N N R C 1 1
  • 32. Types of redundancy Coding if grey levels of image are coded in such away that uses more symbols than is necessary Inter-pixel can guess the value of any pixel from its neighbours Psyco-visual some information is less important than other info in normal visual processing Data compression when one / all forms of redundancy are reduced / removed data is the means by which information is conveyed
  • 33. Coding redundancy  Can use histograms to construct codes  Variable length coding reduces bits and gets rid of redundancy  Less bits to represent level with high probability  More bits to represent level with low probability  Takes advantage of probability of events  Images made of regular shaped objects / predictable shape  Objects larger than pixel elements  Therefore certain grey levels are more probable than others  i.e. histograms are NON-UNIFORM  Natural binary coding assigns same bits to all grey levels  Coding redundancy not minimised
  • 34. Run length coding (RLC)  Represents strings of symbols in an image matrix  FAX machines  records only areas that belong to the object in the image  area represented as a list of lists  Image row described by a sublist  first element = row number  subsequent terms are co-ordinate pairs  first element of a pair is the beginning of a run  second is the end  can have several sequences in each row  Also used in multiple brightness images  in sublist, sequence brightness also recorded
  • 36. Inter-pixel redundancy, IPR  Correlation between pixels is not used in coding  Correlation due to geometry and structure  Value of any pixel can be predicted from the value of the neighbours  Information carried by one pixel is small  Take 2D visual information  transformed  NONVISUAL format  This is called a MAPPING  A REVERSIBLE MAPPING allows original to be reconstructed after MAPPING  Use run-length coding
  • 37.  Due to properties of human eye  Eye does not respond with equal sensitivity to all visual information (e.g. RGB)  Certain information has less relative importance  If eliminated, quality of image is relatively unaffected  This is because HVS only sensitive to 64 levels  Use fidelity criteria to assess loss of information Psyco-visual redundancy, PVR
  • 38. Fidelity Criteria  In a noiseless channel, the encoder is used to remove any redundancy  2 types of encoding  LOSSLESS  LOSSY  Design concerns  Compression ratio, CR achieved  Quality achieved  Trade off between CR and quality Info Source Encoder Channel Decoder Info User Sink NOISE PVR removed, image quality is reduced 2 classes of criteria OBJECTIVE fidelity criteria SUBJECTIVE fidelity criteria OBJECTIVE: if loss is expressed as a function of IP / OP
  • 39. Fidelity Criteria  Input  f(x,y)  compressed output  f(x,y)  error  e(x,y) = f(x,y) -f(x,y)  erms = root mean squared error  SNR = signal to noise ratio  PSNR = peak signal to noise ratio M N y x e e M y N x rms * ) , ( 1 0 1 0 2                  1 0 1 0 2 1 0 1 0 2 ) , ( ) , ( M y N x M y N x ms y x e y x f SNR        1 0 1 0 2 2 ) , ( ) 1 ( * * M y N x y x e L M N PSNR
  • 40. Information Theory How few data are needed to represent an image without loss of info? Measuring information random event, E probability, p(E) units of information, I(E) I(E) = self information of E amount of info is inversely proportional to the probability base of log is the unit of info log2 = binary or bits e.g. p(E) = ½ => 1 bit of information (black and white) ) ( log ) ( 1 log ) ( E p E p E I   
  • 41. Infromation channel  Connects source and user physical medium  Source generates random symbols from a closed set  Each source symbol has a probability of occurrence  Source output is a discrete random variable  Set of source symbols is the source alphabet Info Source Encoder Channel Decoder Info User Sink NOISE
  • 42. Entropy  Entropy is the uncertainty of the source  Probability of source emitting a symbol, S = p(S)  Self information I(S) = -log p(S)  For many Si , i = 0, 1, 2, … L-1  Defines the average amount of info obtained by observing a single source output  OR average information per source output (bits) alphabet = 26 letters  4.7 bits/letter typical grey scale = 256 levels  8 bits/pixel      1 0 2 ) ( log L i i i P P H
  • 43. Filters  Need templates and convolution  Elementary image filters are used enhance certain features de-enhance others edge detect smooth out noise discover shapes in images  Convolution of Images  essential for image processing  template is an array of values  placed step by step over image  each element placement of template is associated with a pixel in the image  can be centre OR top left of template
  • 44. Template Convolution  Each element is multiplied with its corresponding grey level pixel in the image  The sum of the results across the whole template is regarded as a pixel grey level in the new image  CONVOLUTION --> shift add and multiply  Computationally expensive big templates, big images, big time!  M*M image, N*N template = M2N2
  • 45. Convolution  Let T(x,y) = (n*m) template  Let I(X,,Y) = (N*M) image  Convolving T and I gives:  CROSS-CORRELATION not CONVOLUTION  Real convolution is:  convolution often used to mean cross-correlation           1 0 1 0 ) , ( ) , ( ) , ( n i m j j Y i X I j i T Y X I T           1 0 1 0 ) , ( ) , ( ) , ( n i m j j Y i X I j i T Y X I T
  • 46. Templates  Template is not allowed to shift off end of image  Result is therefore smaller than image  2 possibilities  pixel placed in top left position of new image  pixel placed in centre of template (if there is one)  top left is easier to program  Periodic Convolution  wrap image around a ball  template shifts off left, use right pixels  Aperiodic Convolution  pad result with zeros  Result  same size as original  easier to program Template Image Result 1 0 0 1 1 1 3 3 4 1 1 4 4 3 2 1 3 3 3 1 1 1 4 4 2 5 7 6 * 2 4 7 7 * 3 2 7 7 * * * * * *
  • 47. Filters  Need templates and convolution  Elementary image filters are used enhance certain features de-enhance others edge detect smooth out noise discover shapes in images  Convolution of Images  essential for image processing  template is an array of values  placed step by step over image  each element placement of template is associated with a pixel in the image  can be centre OR top left of template
  • 48. Template Convolution  Each element is multiplied with its corresponding grey level pixel in the image  The sum of the results across the whole template is regarded as a pixel grey level in the new image  CONVOLUTION --> shift add and multiply  Computationally expensive big templates, big images, big time!  M*M image, N*N template = M2N2
  • 49. Templates  Template is not allowed to shift off end of image  Result is therefore smaller than image  2 possibilities  pixel placed in top left position of new image  pixel placed in centre of template (if there is one)  top left is easier to program  Periodic Convolution  wrap image around a ball  template shifts off left, use right pixels  Aperiodic Convolution  pad result with zeros  Result  same size as original  easier to program Template Image Result 1 0 0 1 1 1 3 3 4 1 1 4 4 3 2 1 3 3 3 1 1 1 4 4 2 5 7 6 * 2 4 7 7 * 3 2 7 7 * * * * * *
  • 50. Low pass filters  Moving average of time series smoothes  Average (up/down, left/right) smoothes out sudden changes in pixel values removes noise introduces blurring  Classical 3x3 template Removes high frequency components Better filter, weights centre pixel more 1 1 1 1 1 1 1 1 1 1 3 1 3 16 3 1 3 1
  • 51. Example of Low Pass Original Gaussian, sigma=3.0
  • 52. High pass filters  Removes gradual changes between pixels  enhances sudden changes  i.e. edges  Roberts Operators  oldest operator  easy to compute only 2x2 neighbourhood  high sensitivity to noise  few pixels used to calculate gradient 1 0 0 -1 0 1 -1 0
  • 53. High pass filters  Laplacian Operator  known as  template sums to zero  image is constant (no sudden changes), output is zero  popular for computing second derivative  gives gradient magnitude only  usually a 3x3 matrix  stress centre pixel more  can respond doubly to some edges 2  0 1 0 1 -4 1 0 1 0 1 1 1 1 -8 1 1 1 1 2 -1 2 -1 -4 -1 2 -1 2 -1 2 -1 2 -4 2 -1 2 -1
  • 54. Cont.  Prewitt Operator  similar to Sobel, Kirsch, Robinson  approximates the first derivative  gradient is estimated in eight possible directions  result with greatest magnitude is the gradient direction  operators that calculate 1st derivative of image are known as COMPASS OPERATORS  they determine gradient direction  1st 3 masks are shown below (calculate others by rotation …)  direction of gradient given by mask with max response 1 1 1 0 0 0 -1 -1 -1 0 1 1 -1 0 1 -1 -1 0 -1 0 1 -1 0 1 -1 0 1
  • 55. Cont. Sobel good horizontal / vertical edge detector Robinson Kirsch 1 2 1 0 0 0 -1 -2 -1 0 1 2 -1 0 1 -2 -1 0 -1 0 1 -2 0 2 -1 0 1 1 1 1 1 -2 1 -1 -1 -1 3 3 3 3 0 3 -5 -5 -5
  • 56. Example of High Pass Laplacian Filter - 2nd derivative
  • 57. More e.g.’s Horizontal Sobel Vertical Sobel 1st derivative
  • 58. Morphology  The science of form and structure the science of form, that of the outer form, inner structure, and development of living organisms and their parts about changing/counting regions/shapes  Used to pre- or post-process images via filtering, thinning and pruning  Count regions (granules) number of black regions  Estimate size of regions area calculations  Smooth region edges create line drawing of face  Force shapes onto region edges curve into a square
  • 59. Morphological Principles  Easily visulaised on binary image  Template created with known origin  Template stepped over entire image similar to correlation  Dilation if origin == 1 -> template unioned resultant image is large than original  Erosion only if whole template matches image origin = 1, result is smaller than original 1 * 1 1
  • 60. Dilation Dilation (Minkowski addition) fills in valleys between spiky regions increases geometrical area of object objects are light (white in binary) sets background pixels adjacent to object's contour to object's value smoothes small negative grey level regions
  • 62. Erosion Erosion (Minkowski subtraction) removes spiky edges objects are light (white in binary) decreases geometrical area of object sets contour pixels of object to background value smoothes small positive grey level regions
  • 64. Hough Transform Intro edge linking & edge relaxation join curves require continuous path of edge pixels HT doesn’t require connected / nearby points Parametric representation Finding straight lines consider, single point (x,y) infinite number of lines pass through (x,y) each line = solution to equation simplest equation: y = kx + q
  • 65. HT - parametric representation y = kx + q (x,y) - co-ordinates k - gradient q - y intercept Any stright line is characterised by k & q use : ‘slope-intercept’ or (k,q) space not (x,y) space (k,q) - parameter space (x,y) - image space can use (k,q) co-ordinates to represent a line
  • 66. Parameter space q = y - kx a set of values on a line in the (k,q) space == point passing through (x,y) in image space OR every point in image space (x,y) == line in parameter space
  • 67. HT properties  Original HT designed to detect straight lines and curves  Advantage - robustness of segmentation results  segmentation not too sensitive to imperfect data or noise  better than edge linking  works through occlussion  Any part of a straight line can be mapped into parameter space
  • 68. Accumulators Each edge pixel (x,y) votes in (k,q) space for each possible line through it i.e. all combinations of k & q This is called the accumulator If position (k,q) in accumulator has n votes n feature points lie on that line in image space Large n in parameter space, more probable that line exists in image space Therefore, find max n in accumulator to find lines
  • 69. HT Algorithm  Find all desired feature points in image space i.e. edge detect (low pass filter)  Take each feature point increment appropriate values in parameter space i.e. all values of (k,q) for give (x,y)  Find maxima in accumulator array  Map parameter space back into image space to view results
  • 70. Alternative line representation  ‘slope-intercept’ space has problem verticle lines k -> infinity q -> infinity  Therefore, use (,) space  = xcos  + y sin   = magnitude drop a perpendicular from origin to the line  = angle perpendicular makes with x-axis
  • 71. , space In (k,q) space point in image space == line in (k,q) space In (,) space point in image space == sinusoid in (,) space where sinusoids overlap, accumulator = max maxima still = lines in image space  Practically, finding maxima in accumulator is non- trivial often smooth the accumulator for better results
  • 72. HT for Circles Extend HT to other shapes that can be expressed parametrically Circle, fixed radius r, centre (a,b) (x1-a)2 + (x2-b)2 = r2 accumulator array must be 3D unless circle radius, r is known re-arrange equation so x1 is subject and x2 is the variable for every point on circle edge (x,y) plot range of (x1,x2) for a given r
  • 74. General Hough Properties Hough is a powerful tool for curve detection Exponential growth of accumulator with parameters Curve parameters limit its use to few parameters Prior info of curves can reduce computation e.g. use a fixed radius Without using edge direction, all accumulator cells A(a) have to be incremented
  • 75. Optimisation HT With edge direction edge directions quantised into 8 possible directions only 1/8 of circle need take part in accumulator Using edge directions a & b can be evaluated from  = edge direction in pixel x delta  = max anticipated edge direction error  Also weight contributions to accumulator A(a) by edge magnitude
  • 76. General Hough Find all desired points in image For each feature point for each pixel i on target boundary get relative position of reference point from i add this offset to position of i increment that position in accumulator Find local maxima in accumulator Map maxima back to image to view
  • 77. General Hough example  explicitly list points on shape  make table for all edge pixles for target  for each pixel store its position relative to some reference point on the shape  ‘if I’m pixel i on the boundary, the reference point is at ref[i]’