Professional Documents
Culture Documents
Christian E. Portugal-Zambrano
1 Introduction
This practice is about learn how to read a paper and implement it, besides you have
to use all of your code already done, be sure you have done it before try to make this
practice, the paper to implement is about one technique extensively applied to image
processing and pattern recognition, here we revise the fundamentals of the technique
from an array perspective, the original paper is [1] which is attached to this, yes! this
is written on english, although the paper mentioned before is the original idea for this
practice we were working with the paper of [2] which explain it in a more detailed way,
but additional to these paper you can read the report attached called Hall-Beyer3.0, all
this material will give you some references and explain how features are calculated
2 Objectives
3 Pre-requisites
We must require a basic use of arrays 1D, 2D and more, additionally we must have
practice 02 completely resolved.
1
4 Algorithms and code presentation
A
So, as we are working with L TEX algorithms presentation will be easy, you just need to
add this at the header of your document:
\usepackage{algorithm}
\usepackage{algorithmicx}
\usepackage[noend]{algpseudocode}
\usepackage{listings}
\usepackage{color}
\lstset{frame=tb,
language=Java,
aboveskip=3mm,
belowskip=3mm,
showstringspaces=false,
columns=flexible,
basicstyle={\small\ttfamily},
numbers=none,
numberstyle=\tiny\color{gray},
keywordstyle=\color{blue},
commentstyle=\color{dkgreen},
stringstyle=\color{mauve},
breaklines=true,
breakatwhitespace=true,
tabsize=3
}
5 To Do
For this practice you must nd the next results, according to the next notations:
Ng −1 Ng −1
X X
px (i) = p(i, j) py (j) = p(i, j)
j=0 i=0
2
• µ is the mean of µx y µy , dened as:
Ng −1 Ng −1
X X
µx = ipx (i) µy = ipy (i)
i=0 i=0
1 1
Ng −1 2 Ng −1 2
X X
2 2
σx = px (i)(i − µx ) σy = py (i)(i − µy )
i=0 i=0
• adittionaly:
Ng −1 Ng −1
X X
px+y (k) = p(i, j) k = 2, 3, 4, . . . , 2Ng
i=0 j=0 i+j=k
Ng −1 Ng −1
X X
px−y (k) = p(i, j) k = 0, 1, . . . , Ng − 1
i=0 j=0 |i−j|=k
Ng −1 Ng −1
X X
HXY 1 = − p(i, j) log{px (i)py (j)}
i=0 j=0
Ng −1 Ng −1
X X
HXY 2 = − px (i)py (j) log{px (i)py (j)}
i=0 j=0
Ng −1
X p(i, k)p(j, k)
Q(i, j) =
px (i)py (j)
k=0
Ng −1 Ng −1
X X
f1 = p(i, j)2
i=0 j=0
• Contrast (f2)
Ng −1 Ng −1
X X
f2 = P (i, j)(i − j)2
i=0 j=0
• Correlation (f3)
Ng −1 Ng −1
X X (i − µx )(i − µy )p(i, j)
f3 =
σx σy
i=0 j=0
3
• Sum of Squares (Variance) (f4)
Ng −1 Ng −1
X X
f (4) = (i − µ)2 p(i, j)
i=0 j=0
Ng −1 Ng −1
X X 1
f (5) = p(i, j)
1 + (i − j)2
i=0 j=0
• Entropy (f9)
Ng −1 Ng −1
X X
f9 = − p(i, j) log{p(i, j)}
i=0 j=0
N N
!
2 1 X 1 X 2
σ = (xi − µ)2 = xi − µ2
N N
i=1 i=1
where:
N
1 X
µ= xi
N
i=1
so: 2
Ng −1 Ng −1
1 X X
f (10) = px−y (k)2 − px−y (k) ∗ Ng
Ng − 1
k=0 k=0
4
• Dierence Entropy (f11)
Ng −1
X
f (11) = − px−y (k) log{px−y (k)}
k=0
f (9) − HXY 1
f (12) =
max(HX, HY )
1
f (14) = (Second largest EigenValue of Q) 2
where:
X p(i, k)p(j, k)
Q=
px (i)py (k)
k
0.16666667. 0.083333336 0.041666668 0
0.083333336 0.16666667 0 0
0.041666668 0 0.25 0.041666668
0 0 0.041666668 0.083333336
0.22222222 0.055555556 0 0
0.055555556 0.11111111 0.11111111 0
0 0.11111111 0.22222222 0.055555556
0 0 0.055555556 0
0.25 0 0.083333336 0
0 0.16666667 0.083333336 0
0.083333336 0.083333336 0.083333336 0.083333336
0 0 0.083333336 0
5
0.11111111 0.055555556 0.16666667 0
0.055555556 0.11111111 0.055555556 0
0.16666667 0.055555556 0 0.11111111
0 0 0.11111111 0
6
Features for GLCM with 90 as angle:
• (2) Contrast: 1
Test Matrix 2:
255 125 135 68 235
12 36 36 96 56
89 253 195 175 165
13 125 154 48 69
156 23 66 159 125
Its features are:
7
(1) Angular Second Moment: 0.0425
Which leve of quantization is used? Remember that the level of quantization selected is
the same as the dimension of the GLCM, for this test 2 you have to test dierent levels
as 4,8,16, etc, one of them will give you the correct features, to make sure about your
results check if your quantization goes well in the previous test.
6 Deadline
This practice will be considered for the rst evaluation of the course, you must present
and expose your work on May, 7 at class hours, there are not other dates to present your
work. Remember that plagiarism must be avoided and if it is detected the grade will
be zero and repetition informed to superior authorities. A pdf with you CUI must be
presented at the next class, this pdf must be a report about your implementation and
results, you can use the TEX model from here All question and doubts must be done to
email.
References