You are on page 1of 38

EE465: Introduction to Digital Image

Processing Copyright Xin Li 1


DETEKSI TEPI

Dr. R. Rizal Isnanto, S.T., M.M., M.T.

EE465: Introduction to Digital Image


Processing Copyright Xin Li 2
EE465: Introduction to Digital Image
Processing Copyright Xin Li 3
EE465: Introduction to Digital Image
Processing Copyright Xin Li 4
Roadmap
Introduction to image analysis (computer
vision)
Its connection with psychology and neuroscience
Why is image analysis difficult?
Theory of edge detection
Gradient operator
Advanced operators
Applications
Road/sign detection in intelligent driving systems
Pupil detection in iris recognition systems
EE465: Introduction to Digital Image
Processing Copyright Xin Li 5
Computer Vision: the Grand Challenge

Teach a computer to see is nontrivial at all


Unlike binary images, grayscale/color images
acquired by the sensor are often easy to
understand by human being but difficult for a
machine or a robot
There are lots of interesting problems in the
field of computer vision (image analysis)
Image segmentation, image understanding, face
detection/recognition, object tracking
EE465: Introduction to Digital Image
Processing Copyright Xin Li 6
How does Human Vision System work?

Top-down school Bottom-up school


pixels
I see a human body

components (such as
I expect to see a human face edges, lines etc.)

I expect to see two eyes and a nose objects

Two hypothesis and nobody knows the answer yet!

EE465: Introduction to Digital Image


Processing Copyright Xin Li 7
An Amazing Image Example

Person A:
I see an old man with a fancy
earring and a strange hand
Person B:

I see two people on the street


and a dog lying beside
If you try really hard, you will be able
to locate at least eight different faces
from this image

EE465: Introduction to Digital Image


Processing Copyright Xin Li 8
Gestalt Theory (the Berlin School)

Emergence: the dog is perceived as a whole, all at once

EE465: Introduction to Digital Image


Processing Copyright Xin Li 9
Reification

EE465: Introduction to Digital Image


Processing Copyright Xin Li 10
Multistability (or Multistable Perception)

EE465: Introduction to Digital Image


Processing Copyright Xin Li 11
Invariance

EE465: Introduction to Digital Image


Processing Copyright Xin Li 12
Application: Face Detection

You are strongly encouraged to try the interactive demo out yourself

http://vasc.ri.cmu.edu/demos/faceindex/

EE465: Introduction to Digital Image


Processing Copyright Xin Li 13
Roadmap
Introduction to analysis of grayscale images
Why grayscale images are more difficult to
handle?
Edge detection
Gradient operator
Advanced operators
Image segmentation
Basic techniques
Texture segmentation*

EE465: Introduction to Digital Image


Processing Copyright Xin Li 14
Edge Detection
Why detect edge?
Edges characterize object boundaries and are
useful features for segmentation, registration
and object identification in scenes.

What is edge (to human vision system)?


No rigorous definition exists

Intuitively, edge corresponds to singularities in the image


(i.e. where pixel value experiences abrupt change)

EE465: Introduction to Digital Image


Processing Copyright Xin Li 15
Gradient Operators
Motivation: detect changes

change in the pixel value large gradient

image Gradient edge


Thresholding
operator map
x(m,n) g(m,n) I(m,n)
1 | g (m, n) | th
I (m, n)
0 otherwise

MATLAB function: > help edge


EE465: Introduction to Digital Image
Processing Copyright Xin Li 16
Common Operators
Gradient operator

g (m, n) g12 (m, n) g 22 (m, n)

Examples: 1. Roberts operator

0 1 1 0
1 0 0 1

g1 g2

EE465: Introduction to Digital Image


Processing Copyright Xin Li 17
EE465: Introduction to Digital Image
Processing Copyright Xin Li 18
Common Operators (contd)
2. Prewitt operator 3. Sobel operator
1 0 1 1 0 1
1 0 1 2 0 2
vertical
1 0 1 1 0 1

1 1 1 1 2 1
horizontal 0 0 0 0 0 0

1 1 1 1 2 1

EE465: Introduction to Digital Image


Processing Copyright Xin Li 19
Examples

original image horizontal edge vertical edge

Prewitt operator (th=48)


EE465: Introduction to Digital Image
Processing Copyright Xin Li 20
Effect of Thresholding Parameters

small threshold large


EE465: Introduction to Digital Image
Processing Copyright Xin Li 21
Compass Operators
1 1 0 1 1 1 0 1 1
1 0 1 0 0 0 1 0 1

0 1 1 1 1 1 1 1 0
1 0 1 1 0 1
1 0 1 1 0 1

1 0 1 1 0 1
0 1 1 1 1 1 1 1 0
1 0 1 0 0 0 1 0 1

1 1 0 1 1 1 0 1 1
g (m, n) max{| g k (m, n) |}
k
EE465: Introduction to Digital Image
Processing Copyright Xin Li 22
Examples

Compass operator (th=48)


EE465: Introduction to Digital Image
Processing Copyright Xin Li 23
Laplacian Operators
Gradient operator: first-order derivative
sensitive to abrupt change, but not slow change
2
f 2
f
second-order derivative: f 2 2
2

x y
(Laplacian operator)
2 f
0 local extreme in f
x 2

Discrete Laplacian operator


a 1 a a 0 1 0 1 1 1
1 1 4 1 1 8 1
1 a 4 1 a
1 a
a 1 a a 0 1 0 1 1 1
a=0 a=0.5
EE465: Introduction to Digital Image
Processing Copyright Xin Li 24
Zero Crossings
zero crossing

f f f

image Laplacian edge


zero-crossing
operator map
x(m,n) g(m,n) I(m,n)

EE465: Introduction to Digital Image


Processing Copyright Xin Li 25
Examples

original image zero-crossings


Question: why is it so sensitive to noise (many false alarms)?
Answer: a sign flip from 0.01 to -0.01 is treated the same as from 100 to -100

EE465: Introduction to Digital Image


Processing Copyright Xin Li 26
Ideas to Improve Robustness

Linear filtering
Use a Gaussian filter to smooth out noise
component Laplacian of Gaussian
Spatially-adaptive (Nonlinear) processing
Apply different detection strategies to smooth
areas (low-variance) and non-smooth areas (high-
variance) Robust Laplacian edge detector
Return single response to edges (not multiple
edge pixels)
Hysteresis thresholding Cannys edge detector
EE465: Introduction to Digital Image
Processing Copyright Xin Li 27
Laplacian of Gaussian
Generalized Laplacian operator

(m 2 n 2 ) m2 n2
h(m, n) c[1 ] exp( )
2 2 2

Gaussian Laplacian edge


image
LPF () operator map
x(m,n) g(m,n) I(m,n)

Pre-filtering: attenuate the noise sensitivity of the Laplacian

EE465: Introduction to Digital Image


Processing Copyright Xin Li 28
Examples

Better than Laplacian alone but still sensitive due to zero crossing

EE465: Introduction to Digital Image


Processing Copyright Xin Li 29
Robust Laplacian-based Edge Detector
estimate 2
local variance

Laplacian zero yes edge


image 2>th point
operator crossing?
No
No
not an
not an
edge point
edge point

EE465: Introduction to Digital Image


Processing Copyright Xin Li 30
Examples

More robust but return multiple edge pixels (poor localization)

EE465: Introduction to Digital Image


Processing Copyright Xin Li 31
Canny Edge Detector*

Low error rate of detection


Well match human perception results
Good localization of edges
The distance between actual edges in an image
and the edges found by a computational algorithm
should be minimized
Single response
The algorithm should not return multiple edges
pixels when only a single one exists

EE465: Introduction to Digital Image


Processing Copyright Xin Li 32
Flow-chart of Canny Edge Detector*
(J. Canny1986)
Original image

Smoothing by Gaussian convolution

Differential operators along x and y axis

Non-maximum suppression
finds peaks in the image gradient

Hysteresis thresholding locates edge strings

Edge map
EE465: Introduction to Digital Image
Processing Copyright Xin Li 33
Canny Edge Detector Example

original image vertical edges horizontal edges

norm of the gradient after thresholding after thinning


EE465: Introduction to Digital Image
Processing Copyright Xin Li 34
Marr and Hildreths Method*
Edge is scale-dependent

A different edge map can be generated at different scale

Scale space representation

f ( x , y ; s ) f ( x , y ;0 ) g ( x , y ; s )
coarse-scale fine-scale Gaussian kernel
image image with width of s
1 x2 y2
g ( x, y; s) exp( )
2s 2s
EE465: Introduction to Digital Image
Processing Copyright Xin Li 35
Importance of Scale

EE465: Introduction to Digital Image


Processing Copyright Xin Li 36
Scale-Space Edge Detection Examples

fine coarse

EE465: Introduction to Digital Image


Processing Copyright Xin Li 37
Image to Sketch Online Apps

http://sporkforge.com/imaging/sketch.php

EE465: Introduction to Digital Image


Processing Copyright Xin Li 38

You might also like