The Course: Image Representation Image Statistics Histograms Entropy Filters Books
The Course: Image Representation Image Statistics Histograms Entropy Filters Books
Classification / decision
Acquisition,
preprocessing
HIGH
Algorithm Amount of no intelligence
Complexity Data
Extraction, edge
Increases MEDIUM Decreases
joining
LOW Recognition,
interpretation
intelligent
Raw data
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 N
F(x,y), F(x1,x2), F(x)
F - intensity, grey level f(o,o)
x,y - spatial co-ordinates
M
No. of grey levels, L = 2B
B = no. of bits f(N-1,M-1)
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
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)
S=0
Green Hue degrees:
Red Red, 0 deg
Green 120 deg
Green Blue 240 deg
V=0
Use of colour space
Image quality
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
P3
# feep.ppm
44
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
M 1 N 1
f ( x, y)
y 0 x 0
MEAN =
N *M
M 1 N 1
( f ( x , y ) ) 2
VARIANCE 2 = y 0 x 0
N *M
MAX
Area under histogram
h (l )
l 0
Total number of pixels N*M
unimodal, bimodal, multi-modal, dark, light, low contrast, high
contrast
Probability Density
Functions, p(l)
L
E (l ) max( o, round (( ) * t (l )) 1)
N *M
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
Histogram equalisation
examples
Image transmission
noise usually independent image signal
additive, noise v and image signal g are independent
NOISE
In a noiseless channel, the
encoder is used to remove any
redundancy
PVR removed, image quality is
2 types of encoding
reduced
LOSSLESS
2 classes of criteria
LOSSY
OBJECTIVE fidelity criteria
SUBJECTIVE fidelity criteria
Design concerns
OBJECTIVE: if loss is expressed
Compression ratio, CR achieved
as a function of IP / OP
Quality achieved
Trade off between CR and quality
Fidelity Criteria
Input f(x,y) M 1 N 1
e( x, y) 2
f ( x, y)
y 0 x 0
2
SNRms M 1 N 1
e( x, y)
y 0 x 0
2
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)
1
I ( E ) log log p( E )
p( 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)
Infromation channel
NOISE
0 1 1 0
-1 0 0 -1
High pass filters
Laplacian Operator
known as
2
0 1 0 1 1 1
template sums to zero 1 -4 1 1 -8 1
image is constant (no sudden 0 1 0 1 1 1
changes), output is zero
popular for computing second
derivative
2 -1 2 -1 2 -1
gives gradient magnitude only
-1 -4 -1 2 -4 2
usually a 3x3 matrix
2 -1 2 -1 2 -1
stress centre pixel more
can respond doubly to some
edges
Cont.
Prewitt Operator
similar to Sobel, Kirsch, Robinson 1 1 1
approximates the first derivative
0 0 0
gradient is estimated in eight
possible directions -1 -1 -1
result with greatest magnitude is the
gradient direction 0 1 1
operators that calculate 1st derivative -1 0 1
of image are known as COMPASS -1 -1 0
OPERATORS
they determine gradient direction
1st 3 masks are shown below
-1 0 1
(calculate others by rotation …) -1 0 1
direction of gradient given by mask -1 0 1
with max response
Cont.
Sobel Robinson
good horizontal / vertical 1 1 1
edge detector 1 -2 1
1 2 1 -1 -1 -1
0 0 0
-1 -2 -1
Kirsch
-1 0 1
-2 0 2 3 3 3
3 0 3
-1 0 1
-5 -5 -5
0 1 2
-1 0 1
-2 -1 0
Example of High Pass
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