Title: Pixel Operations: Histograms
1Pixel Operations Histograms
8x8 picture, 3 bits 8 levels
intensity
n,x hist(G(),(07))
Frequency (pels)
Probability (freq/64)
0
7
0
0
2
2
6
6
6
6
25
2
2
2
2
6
6
6
6
0
0
6
6
7
7
7
7
0
3
3
0
6
6
7
15
Freq.
6
6
6
6
7
7
7
7
0
1
1
0
7
7
7
7
5
0
0
1
1
7
7
7
7
7
7
7
7
7
7
7
7
0
1
2
3
4
5
6
7
7
Intensity Level
2Real Histogram 8 bit pic
784
1088
latex
3Histogram Equalisation
i
Levels
H(i)
Target H(i)
m
To have 16 pels at intensity 1, take all from
I1,2 and 8 from I 3 and map onto intensity 1
because H(1) H(2) 8 16 To have 16 pels at
intensity 2 Take remainder (21-8)13 at level 3,
add to 3 from level 4 So intensity mapping is
1,2,3 -gt 1 3,4 -gt2 etc etc
latex
4Hist. Equalisation with CuF
i
Levels
H(i)
CuF(i)
Target H(i)
m
Target CuF(i)
m
Resulting transformation
5Histogram Equalisation
Matlab imadjdemo Try it
6About that storyboard problem
Shot 1
Shot 2
Shot 3
Shot 4
Cut 1
Cut 2
Cut 3
7Using Histograms
60
61
62
63
64
65
Frame Index
8Detecting cuts using Histograms
n
64
H
64
n-1
18
18/64 gt 28 change
9Detecting cuts using Histograms
10Histograms better than Frame difference
Frame Difference
Histograms
11The demo again just to remind you
Back to latex
12Primitive functions in 2D
h
u(h,k)
h
(0,0)
k
(h,k)
d
(h-1,k-1)
d
(h,k-1)
d
k
Plan
Latex
13Convolution in 2D
0
p(0,0)
p(0,1)
0
0
0
0
0
p(1,0)
p(1,1)
-1
.2
0
0
1
2
3
Input Image
.3
.5
0
0
4
5
6
I(h,k)
Impulse Response
p(h,k)
0
0
7
8
9
0
0
0
0
0
p(1,0)
p(1,1)
At each output Pixel overlay, find products then
add
0
Flip Impulse Response
p(0,0)
p(0,1)
n1 -h n2 -k
0
0
0
0
0
-1
0
0
0
0
g(h,k)
0
0
0
0
0
0
0
14Convolution in 2D
0
p(0,0)
p(0,1)
0
0
0
0
0
p(1,0)
p(1,1)
-1
.2
0
0
1
2
3
Input Image
.3
.5
0
0
4
5
6
I(h,k)
Impulse Response
p(h,k)
0
0
7
8
9
0
0
0
0
0
p(1,0)
p(1,1)
At each output Pixel overlay, find products then
add
0
Flip Impulse Response
p(0,0)
p(0,1)
n1 -h n2 -k
0
0
0
0
0
-1
0
0
-.8
0
0
g(h,k)
0
0
0
0
0
0
0
15Convolution in 2D
0
p(0,0)
p(0,1)
0
0
0
0
0
p(1,0)
p(1,1)
-1
.2
0
0
1
2
3
Input Image
.3
.5
0
0
4
5
6
I(h,k)
Impulse Response
p(h,k)
0
0
7
8
9
0
0
0
0
0
p(1,0)
p(1,1)
At each output Pixel overlay, find products then
add
0
Flip Impulse Response
p(0,0)
p(0,1)
n1 -h n2 -k
0
0
0
0
0
-1
0
0
-.8
Filter mask
0
0
g(h,k)
0
0
-3.1
0
0
0
0
0
Latex
16Image Extension for boundary conditions
Zero extension
Image
Periodic Extension
Extension by reflection
Latex
17Convolution identities
f(h,k)
Associativity
p(h,k) () g(h,k)
f(h,k)
Distributivity
18Causality (examining impulse response support)
Non Causal
Output Location of mask
Causal
Filter Support
Semi-Causal
Latex
Or Causal if TV Raster used as causality reference
19Filtering as a matrix operation
H is Block Diagonal, Symmetric
If i is extended using a periodic extension, then
H becomes circulant
Latex