Information Technology Reference
In-Depth Information
where
R
i
denotes the value of the bin which is obtained by projecting,
i
∈
[0
,N
−
1] is the number of the bin, which represents the position of the bin on
the horizontal axis,
N
is the diagonal length of the template image,
θ
[0
,
359]
is the value of the projection angle, which denotes the number of the histogram.
Furthermore, the defect dictionary
D
d
will be proposed. In most cases, the
defect whose width or height is more than 5 pixels cannot be tolerated. Therefore,
a circular region with the 5-pixel diameter is regarded as minimum basic unit,
whose projection can be got as
p
i
=[3
,
5
,
5
,
5
,
3]
T
,where
i
is the descriptor of the
central location. Motivated by the work in [9], we propose a defect dictionary
D
d
that can be obtained by successive change the position of
p
i
,where
i
=
0
,
1
,
∈
1.
D
d
is similar as the 'trivial templates' in literature [9], which is
constituted as follows
···
N
−
⎛
⎞
p
0
0
⎝
⎠
.
.
.
D
d
=
(8)
p
N−
1
0
Due to five nonzero terms adjacent in the atoms of
D
d
, the residual less than
the width of 5 pixels is ignored.
4 Fast Algorithm
When the template dictionary
D
t
and the defect dictionary
D
d
are obtained,
the further task is to detect for sample bottle caps. Assume the vertical pro-
jection histogram and the horizontal projection histogram of the sample ROI
are denoted by
X
1
and
X
2
respectively. Using expression (6), the defect sparse
factors
α
d
and
α
d
can be obtained with respect to
X
1
and
X
2
respectively. The
non-zero elements in
α
d
and
α
d
corresponds to defects, see Fig.3. As shown in
Fig.3, because two defect sparse factors are orthogonal, the location and size of
the defect can be determined. In order to get
α
d
and
α
d
quickly, a novel method
which includes two steps is proposed. The detail process will be addressed as the
following example of
α
d
. The way of solving
α
d
is similar as that of
α
d
.
Firstly, according to (6),
α
t
should be solved.
α
t
is a template sparse factor
with respect to
X
1
. The element in the sparse factor
α
t
, which corresponds
to the best match column in the template dictionary
D
t
, is set to one, and
the other elements of the sparse factor
α
t
are set to zero. Thus, the following
equation is obtained,
α
t
0
=
α
t
1
= 1. Without loss of generality, we assume
that the best match column is
j
th. Obviously, the following resolutions is hold,
α
t
=
s
0
···
0
T
, s∈ R
.
Secondly,
α
d
is obtained. Substituting
α
t
1
= 1 into (6), we have
α
d
=argmin
α
d
1
,
s
359
T
=
0
s
j−
1
s
j
s
j
+1
······
···
010
······
st.
X
1
−
D
d
α
t
2
D
t
α
t
−
ε.
(9)
Search WWH ::
Custom Search