Image processing “Histogram-based operators” Mathieu Delalandre François-Rabelais University, Tours city, France
[email protected]
1
Histogram-based operators 1. Fundamentals of histogram-based operators 2. Some histogram-based operators 2.1. Image characterization 2.2. Optimum thresholding 2.3. Histogram equalization 2.4. Histogram-based distances 3. Further investigations
2
Fundamentals of histogram-based operators (1) The histogram of a digital image is a representation of its intensity distribution such as The image I(i,j) = v is a discrete function i,j the coordinates of a pixel i ∈ [0, N[ and j ∈ [0, M[ v is the pixel intensity value with 0≤v≤ L
M×N
is the size of the array (in pixels)
The histogram h(k) = nk is a discrete function k the intensity value k∈[0, L] is the intensity level range nk is the number of pixels in the image of intensity k L
∑ h(k ) = N × M k =0
e.g. Raster with N=3 M=4 N×M=12 q=3
0 ≤ I (i, j ) ≤ 7
1
2
1
4
2
0
3
3
3
2
0
4
Histogram with k∈[0, 7] 7
∑ h(k ) = 12 k =0
Numbers of pixels 4 3 2
a pixel I(1,2) = 3
1 0 1 2 3 4 5 6 7
Intensity levels
a pixel distribution, h(k=3) = 3 i.e. the number of “3” 3
Fundamentals of histogram-based operators (2)
Raster with N=3 M=4 N×M=12 q=3
1
2
1
4
2
0
3
3
3
2
0
4
0 ≤ I (i, j ) ≤ 7
The basic image histogram is Numbers of pixels
h(k ) = nk
The normalized image histogram is Numbers of pixels
4
4/12
3
3/12
2
2/12
1
1/12 0 1 2 3 4 5 6 7
Intensity levels
0
p ( k ) = h( k )
0 1 2 3 4 5 6 7
The accumulated image histogram is k
N ×M
Intensity levels
p(k) defines the probability to get the value k in the image I
Numbers of pixels
c( k ) = ∑ p ( p ) p=0
12/12 11/12 10/12 9/12 8/12 7/12 6/12 5/12 4/12 3/12 2/12 1/12
0
0 1 2 3 4 5 6 7
Intensity levels
c(k) defines the probability to get the value less or equal to k in the image I
4
Fundamentals of histogram-based operators (3) 18000 16000 14000 12000 10000
n-colors images result in n-bins histograms
8000 6000 4000 2000 0
0
50
100
150
200
250
300
350
300
250
200
histograms are global representations excluding image topology
150
100
50
0
0
50
100
150
200
250
300
Random pixel permutation 5
Fundamentals of histogram-based operators (4) Histogram-based operations include any statistical processes of intensity distribution. They could be based on single or multiple entries. h
I image
Histogrambased operations
Histogram extraction
results
e.g. Numbers of pixel 4 1
2
1
4
3
2
0
3
3
2
3
2
0
4
1 0 1 2 3 4
Typical results include - an image - some features
image
Histogram extraction
Numbers of pixel Histogrambased operations
image
I2
To rank intensity levels by shifting one value k=2 to k=4
h1
I1
Intensity levels
Histogram extraction
4 results
Typical results are distances
1
2
1
4
3
2
0
3
3
2
3
4
0
4
1 0 1 2 3 4
h2 shifted value
Intensity levels
6
Fundamentals of histogram-based operators (5) Histogram-based operations include any statistical processes of intensity distribution. They could be based on single or multiple entries. h
I image
Histogrambased operations
Histogram extraction
Histogram-based operations are related to image characterization (or features extraction), automatic thresholding, image enhancement (histogram equalization), image matching (histogram-based distances), etc.
results
Typical results include - an image - some features
h1
I1 image
Histogram extraction Histogrambased operations
image
I2
Histogram extraction
results
Typical results are distances
h2
7
Histogram-based operators 1. Fundamentals of histogram-based operators 2. Some histogram-based operators 2.1. Image characterization 2.2. Optimum thresholding 2.3. Histogram equalization 2.4. Histogram-based distances 3. Further investigations
8
Type
Methods
Application
Mean, standard deviation Contrast Moments Image Entropy characterization Co-occurrence matrix
Feature extraction
Uniformity, homogeneity Correlation Thresholding
Otsu’s method
Enhancement, segmentation
Histogram equalization
Histogram equalization
Enhancement
Histogram-based Minkowski, χ2, distance Kulback-Leibler and Jeffrey
Comparison, retrieval, spotting
9
Image characterization “Mean and standard deviation” Characterization with mean and standard deviation From raster
From histogram L
N −1 M −1
Mean (m)
Standard deviation (σ)
∑ k × h(k )
∑ ∑ I (i, j ) N −1 M −1
∑ ∑ (I (i, j ) − m ) i =0 j = 0
∑ k × p(k ) k =0
N ×M
N ×M 2
L
m=
L
k =0
i = 0 j =0
L 2 σ =0
From normalized histogram
∑ (k − m )
2
× h(k )
k =0
L
∑ (k − m )
2
k =0
m=
× p (k )
1 L 2 2
2
σ = 2× × =
N ×M
N×M
L 1 1 ×0+ × L = 2 2 2 L 2
Rq. Standard deviation is also defined as the squared root of the variance σ = v Complexity comparison of raster vs. histogram-based operations
image
access / increment operations
Image-based operation Mean raster Mean histogram
image
Histogram extraction
Histogrambased operation
STD raster STD histogram
arithmetic operations add/ multiply square divide subtract
N×M
N×M
1
0
1
2×N×M
2q
2q
0
1
N×M
2×N×M
1
N×M
1
2×N×M
2×2q
2q
2q
1
with N × M >> 2 q and Ο(access)