Professional Documents
Culture Documents
Image Characteristics
Image Mean
I (i, j )
i j
I av
1 i j
x
I
INEW(x,y)=I(x,y)-b
x
Changing the image mean
Image Contrast
• The local contrast at an image point denotes the
(relative) difference between the intensity of the point
and the intensity of its neighborhood:
I p In
C
In
0.7
0.5
0.3
0.1
x x
INEW(x,y)=·I(x,y)+
Occurrence
(# of pixels)
Gray Level
10000
5000
Histogram
0
1 2 3 4 5 6 7 8 9 10
gray level
0.25
0.2
0.15
Normalized Histogram
0.1
0.05
0
1 2 3 4 5 6 7 8 9 10
gray level
0.8
Accumulated Histogram
0.6
0.4
0.2
0
1 2 3 4 5 6 7 8 9 10
gray level
Examples
P(I) P(I)
1
1
0.5
I I
H(I) H(I)
0.1
0.1
I I
Pixel permutation of
the left image
P(I)
P(I)
0.1
Increasing average
I
Image Statistics
1 1
• The image mean: E I I (i, j ) k H k k P k
N i, j N k k
• Generally: E g k g k P k
k
where E I 2 k 2 P k
0.25
0.2
k
0.15
0.1
0.05
0
1 2 3 4 5 6 7 8 9 10
gray level
Image Entropy
Entropy I P k log P k
k
0.6
0.5
entropy(P )
0.4
0.3
0.2
0.1
0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
P
Entropy of a 2 values variable
• An infrequent event provides more information than a
frequent event
• Entropy is a measure of histogram dispersion
1000
800
600
400
200
entropy=7.4635
10000
9000
8000
7000
6000
5000
4000
3000
2000
1000
entropy=0
Adaptive Histogram
• In many cases histograms are needed for local areas in
an image
• Examples:
– Pattern detection
– adaptive enhancement
– adaptive thresholding
– tracking
Implementation: Integral Histogram
H(x-1,y-1)
H(x,y-1)
H(x,y)
H(x-1,y) porkili 05
y (x2,y1)
(x1,y1)
(x1,y2) (x2,y2)
3000
2000
1000
0
0 10 20 30 40 50 60
4000
3000
2000
1000
0
0 10 20 30 40 50 60
kold
255
Threshold value
Threshold Selection
Original Image Binary Image
50 75
Threshold = 50 Threshold = 75
Segmentation using Thresholding
Original Histogram
21
Threshold = 21
Adaptive Thresholding
• Thresholding is
space variant.
• How can we choose
the the local
threshold values?
Color Segmentation
• Segmentation is based on
color values.
• Apply clustering in color
space (e.g. k-means).
• Segment each pixel to its
closest cluster.
Histogram based image distance
• Example Usage:
– Tracking
– Image retrieval
– Registration
– Detection
– Many more ...
Porkili 05
Option 1: Minkowski Distance
1/ p
p
D p A, B PA (k ) PB (k )
k
<
Option 2: Kullback-Leibler (KL) Distance
PA k
DKL A || B PA k log
k PB k
>
Option 3: The Earth Mover Distance (EMD)
(amount moved)
DEMD ( A, B) min f ij d ij
F
i j
s.t. f ij 0 ; PB k f ik ; PA k f ki
i i
• Constraints:
– Move earth only from A to B
– After move PA will be equal to PB
– Cannot send more “earth” than there is
• Can be solved using Linear Programming
• Can be applied in high dim. histograms (color).
Special case: EMD in 1D
DEMD A, B C A k C B k
k
PA CA
PB CB
CA-CB
THE END
38