TELKOM
NIKA
, Vol.11, No
.11, Novemb
er 201
3, pp. 6951
~6
955
e-ISSN: 2087
-278X
6951
Re
cei
v
ed
Jun
e
2, 2013; Re
vised July 3
1
, 2013; Accept
ed Augu
st 12
, 2013
Study on the Method of the Self-adapting Image
Threshold Divided in the Surface Image of the Tubular
Cartridge Case
Wu Qizhou*,
Jin Yong, Wang Zhao
b
a
1
Nation
al Ke
y
Lab for Electro
n
ic Meas
urem
ent T
e
chnolo
g
y
North U
n
iv
er
sit
y
of Chi
na, T
a
i Yua
n
03
005
1,
Chin
a, Ph./F
ax: (0086) 35
1-3
559
32
1/355
93
21
Corresp
on
din
g
author, e-mai
l
: qizho
u
w
u
@1
2
6
.com*, jin
y@
n
u
c.edu.cn,
w
a
n
g
zb@
nuc.ed
u
.
c
n
A
b
st
r
a
ct
T
he tech
nol
og
y of detecti
ng t
he i
n
tern
al
and
externa
l
di
ame
t
e
r
o
f
th
e tu
bu
l
a
r ca
rtri
d
g
e
ca
se
that
usin
g sca
nistor
to o
b
tain
the
i
m
a
g
e
of th
e tu
bul
ar cart
ri
dge
case
surface,
ai
mi
ng
at th
e
differenc
e i
n
th
e
imag
e of
the
surface
betw
e
en th
e
de
gree
of co
lor
gr
ay.
T
h
is
article
p
r
opos
ed
the s
e
lf-ad
aptin
g
i
m
ag
e
thresho
l
d d
i
vi
d
ed
meth
od th
at base
on
me
an
and sta
n
d
a
rd
differenc
e of th
e i
m
a
ge of th
e
surface us
ing t
o
defin
iting thres
hol
d, solved th
e key questi
on
of the su
rface ima
ge
ma
nip
u
l
atio
n, ma
k
e
the detectin
g
res
u
l
t
reach
i
ng th
e u
pper pr
ecisi
on.
Ke
y
w
ords
:
sur
f
ace imag
e, sel
f
-adapti
ng, thre
shol
d divi
de
d
Copy
right
©
2013 Un
ive
r
sita
s Ah
mad
Dah
l
an
. All rig
h
ts r
ese
rved
.
1. Introduc
tion
A grain
as th
e non
-metalli
c an
d op
aqu
e obje
c
ts, i
s
an impo
rtant
part of the
wea
pon
laun
ch
syste
m
and it ha
s
a cylind
r
ic
al h
o
le shap
e (S
hown in Fig
u
re 1). Th
e ge
o
m
etry of internal
diamete
r
(ID) and out
side d
i
ameter (OD)
is
dire
ctly rela
ted to system
performan
ce
.
Figure 1. Sch
e
matic Di
ag
ram of Tubula
r
Grai
n
In this arti
cle,
we
p
r
o
c
e
s
s
and
se
gment
at the
face i
m
age, th
en
u
s
e th
e
edge
s of the
image to stri
ke ID and O
D
.
Whe
n
u
s
e
d
this m
e
thod
to dete
n
te th
e ID
and OD
of
many gra
i
n,
the sha
r
p
ness of
image ed
ge
and the si
ze
of the background n
o
ise
whi
c
h we get
had a signifi
cant impa
ct on
accuracy and
repeatability
of the final t
e
st results. T
herefore,
to
obtain im
ages of objects,
we
need an o
b
je
ct with uniform light exposure, or the
in
con
s
i
s
tent gray scal
e
of image
s
mu
st cau
s
e
the accu
ra
cy and repeata
b
i
lity down in
te
st re
sults. As
light sou
r
ce o
f
the sca
nne
r is owned, ha
s
uniform
illumi
nation, can obtain a
good
consisten
cy of gray
-scale image. T
herefore, i
n
this
pape
r, the scanne
r wa
s u
s
ed as a
n
ima
ge acqui
sition
system.
2.
The Proce
s
s
of Grain Fac
e
Image Acq
u
isition
In the produ
ction process
of
grai
n, there are some
chemic
al rea
c
tions
are som
e
times
incom
p
lete
compon
ents,
resultin
g in u
n
e
ven color of
grai
n, co
uple
d with the
da
rk
col
o
r of
grain
(Figu
r
e 1
)
, so
, to take full advantag
e of the dy
nami
c
rang
e of the
scann
er, we
need
scann
er to
scan und
er t
he high sen
s
i
t
ivity. In
this pape
r, we u
s
ed the metho
d
s of lose b
a
c
kgro
und ima
g
e
,
Evaluation Warning : The document was created with Spire.PDF for Python.
e-ISSN: 2
087-278X
TELKOM
NIKA
Vol. 11, No
. 11, Novemb
er 201
3: 695
1 – 6955
6952
that is, when
dete
c
tion, first sca
n
the
backg
ro
u
nd t
o
get the
ba
ckgro
und
im
age
(Figu
r
e
2(a
)
sho
w
s), a
nd
then pla
c
e
d
the mea
s
u
r
e
d
grain ve
rt
ically in th
e
detectio
n
reg
i
on (Fi
g
u
r
e 2
(
b)
sho
w
s). Figu
re 2(b
)
minu
s Figure 2(a
)
is Figure
2
(
c), that is the fina
l sca
n image
of end grai
n.
Figure 2. The
Proce
s
s of Grain Fa
ce Ima
g
e
3.
The Image T
h
reshold Se
gmenta
tion
of Ad
aptiv
e
Figure 3 sh
own th
at two typical g
r
a
i
n face im
ag
es a
nd g
r
ay
curve i
n
th
e sam
e
colle
ction. Grain face ima
g
e
has two ch
ara
c
teri
stics:
The g
r
ay val
ue of fa
ce i
m
age
quite
different in t
he same
gra
i
n; Differe
nt grain
face
image
s have
different brig
h
t
ness in the same acqui
si
tion, Figure 3. That is be
cau
s
e, in the grai
n
prod
uctio
n
p
r
oce
s
s cau
s
e
d
the grain
colo
r un
even
and the
gra
y
value of face ima
ge q
u
i
t
e
different.
Grain
face im
age
s were
no
n-ci
rcula
r
an
d
the insi
de a
n
d
outsi
de di
a
m
eter h
a
ve di
fferent
heart. That is
becau
se, in the cutting p
r
o
c
e
ss, g
r
ain b
y
uniform force.
(a)
1#orgin
a
l i
m
age
(b)
1#gra
y
c
u
r
v
e of horizo
n
tal
(c) 2# gra
y
cur
v
e of vertical
(d) 2#or
igi
nal i
m
age
(e) 2# gra
y
cur
v
e of horizo
n
tal
(f) 2#gra
y
curv
e of vertical
Figure 3. The
Face Imag
e of Single Grai
n
With the
pu
rp
ose
of e
a
sy t
o
read
the
si
ze,
image
mu
st be bi
na
ried,
therefo
r
e
we
have to
sele
ct a thre
shold to sepa
rate the image
. In
the general image, grai
n face ima
ge
have high g
r
a
y
Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM
NIKA
e-ISSN:
2087
-278X
Study on the
Method of the
Self-adaptin
g Im
age Thre
shol
d Di
vided
…
(Wu Qizho
u
)
6953
level than ba
ckgro
und,
when the thre
shol
d is t
oo
high, pa
rt of edge poi
nts were wrong
to
backg
rou
nd
points, m
ade
the si
ze
of ID an
d O
D
to
o sm
all. Oth
e
rwi
s
e, to
o l
a
rge.
The
ke
y to
segm
entation
is sele
ct the approp
riate thre
shol
d.
Fro
m
the two fea
t
ures
of the above image,
we
can
see, if we use a fixed
threshold to
split mult
iple g
r
ain
we collected, the measured
grai
n si
ze
in diamete
r
must be som
e
large
r
, som
e
smalle
r. So we re
sea
r
ch
a method which a
c
cordin
g to
the image inf
o
rmatio
n ca
n determi
ne the
thresh
old aut
omatically.
This p
ape
r prese
n
ts a
seg
m
entation, kn
own a
s
a
dap
tive thresh
old
i
ng se
gme
n
ta
tion of
image, that i
s
a meth
od to
determi
ne the
thre
shol
d a
c
cording
to me
an an
d
stand
a
rd
deviation
of
gray. This m
e
thod ca
n solv
e the probl
em
.
The im
age i
s
set to,
N
j
M
i
),
j
,
i
(
f
,
,
,
, are th
e
mean
and
stand
ard
dev
iation of the
image, the
n
t
he
segm
ent
a
t
ion thre
sh
ol
d (T
H) of the
image
can
be
determi
ned a
s
follows:
a
TH
(1)
In the above
formula, a is a factor for
adju
s
ting, it can be calibra
ted according
to the
actual
grain
size an
d the
test result
s.
After obtain
e
d the th
re
shold valu
e
0
v
, we
can
bina
ry
segm
entation
the image according to the
following formula:
0
0
)
,
(
0
)
,
(
1
)
,
(
v
j
i
f
v
j
i
f
j
i
u
(2)
After a nu
m
ber
of expe
ri
ments,
calib
rate t
he a
d
ju
stment fa
ctor a = 0.5, all
of the
followin
g
dia
m
eter me
asu
r
eme
n
ts
were
use
d
in th
i
s
value. Figu
re
4 is the im
ag
es afte
r ada
p
t
ive
image thresh
old se
gmenta
t
ion of 1 # gra
i
n.
(a) Origin
al im
age
(b) Binar
y se
g
m
entatio
n
Figure 4. Adaptive Image Segmentatio
n
of 1# Grain
4. Analy
s
is
To test the
re
sults
of ada
ptive image
se
gment
ation te
chni
que
com
pare
d
with
si
x grain
s
to
do
expe
ri
ments. Figu
re
5 is the ori
g
inal
image
of six grains,
table 1 are the mea
s
ure
m
ent
results
of the ada
ptive image
se
gme
n
tation tech
n
i
que
s
an
d fixed thre
sh
ol
d se
gme
n
tation
techni
que
s.
Figure 5. The
Original Ima
ge of Six Grains
Evaluation Warning : The document was created with Spire.PDF for Python.
e-ISSN: 2
0
87-278X
TELKOM
NIKA
Vol. 11, No
. 11, Novemb
er 201
3: 695
1 – 6955
6954
Table 1. Co
m
pare Ad
aptive Image Seg
m
entat
ion Te
chni
que
with Fixed Thre
sh
old
Segmentatio
n
number
1 2 3 4 5
6
mean
mean
gra
y
47.6 57.5 61.1 55.0
58.0
44.4
——
Standard
value
o
f
OD(mm)
8.69 8.70 8.72 8.66 8.72 8.56
8.675
Standard
value
o
f
ID(mm)
5.32 5.28 5.30 5.27 5.34 5.12
5.275
adaptive
threshold
(
TH=
-
0.45
)
TH
31 38 41 37 38 28
——
OD(m
m)
8.67 8.71 8.71 8.68 8.72 8.55
8.673
error(mm)
0.02 -0.01
0.01 -0.02
0
0.01
——
ID(mm)
5.33 5.29 5.32 5.29 5.34 5.10
5.278
error(mm)
-0.01
-0.01
0.02
-0.02
0
0.02
——
fixed
threshold
(
TH=2
8
)
TH
28 28 28 28 28 28
——
OD(m
m)
8.68 8.75 8.78 8.73 8.75 8.55
8.707
error(mm)
0.01
-0.05
-0.06
-0.07
-0.03
0.01
——
ID(mm)
5.33 5.32 5.32 5.31 5.36 5.10
5.297
error(mm)
-0.01
-0.04
-0.02
-0.04
-0.02
0.02
——
As can b
e
se
en from Tabl
e 1, 3# grain
face imag
e with the large
s
t mean of gra
y
(61.1),
6# g
r
ain fa
ce
image
with th
e minimu
m m
ean of
gray
(44.4), 3
#
g
r
ai
n ca
n al
so
be
see
n
that i
s
t
h
e
brightn
e
ss. Therefo
r
e, wh
en the image
binari
z
ati
on,
we sho
u
ld b
e
base
d
on the statu
s
of the
face im
age
o
f
grain
to
sel
e
ct
corre
s
p
o
nding
thre
sh
old, so that t
o
mea
s
u
r
e
th
e ide
a
l si
ze
of ID
and O
D
. Use the ada
ptive image se
gmentation t
e
ch
niqu
e to the grai
ns from 1# to 6#
, the
threshold
val
ues were
obt
ained
31, 3
8
, 41, 3
7
, 38, 2
8
. Mea
s
u
r
ed
the maximum
error of o
u
tsi
d
e
diamete
r
is
0.02mm a
n
d
the maximu
m error
of
insid
e
diam
eter is
0.02m
m can
meet
the
requi
rem
ents of techni
cal i
ndicators. If the th
res
hold
of grain #
6
(28)
as the
st
anda
rd, u
s
e
the
fixed thre
shol
d techniqu
e t
o
di
smemb
e
r the ima
g
e
s
,
can
we me
a
s
ured th
e ma
ximum erro
r
of
outsid
e
diam
eter is 0.07m
m and the maximum error
of inside dia
m
eter is 0.04
mm, that is fa
r
beyond
the
requireme
nts
of the te
ch
ni
cal i
ndi
cato
rs. In Figu
re
6,
we
u
s
e
the
two te
ch
nolo
g
i
es
measured th
e error
cu
rve
of ID and O
D
, that fu
lly descri
be
s the
effective of adaptive ima
g
e
segm
entation
techniq
ue which p
r
op
ose
d
in this pap
e
r
.
1—mea
s
u
r
e
m
ent error of
adaptive thre
shol
d se
gme
n
tation tech
ni
que
2—mea
s
u
r
e
m
ent error of
fixed thresh
ol
d segm
entati
o
n
Figure 6. Measu
r
em
ent Error of Adaptiv
e
Thre
sh
oldin
g
and fixed Thre
shol
ding
To illustrate the differe
nce
s
between th
e two
metho
d
s mo
re di
re
ctly, plotted the gray
curve
s
of 3#
and 6# g
r
ai
n in Figu
re 6
,
TH1 is the
threshold d
e
termin
ed by
adaptive im
age
segm
entation
tech
niqu
es.
TH2 i
s
th
e
thre
sh
ol
d
d
e
termin
ed
b
y
fixed imag
e segm
entati
o
n
techni
que
s. The figure sho
w
s, the gray of edge is
gradient, not Step mutation that is not ide
a
l.
The im
age
gray of 3#
grai
n is big,
6#
g
r
ain i
s
sm
all,
the si
ze
by T
H
2
=
28
to
se
gment 3
#
g
r
a
i
n
must b
e
la
rg
er tha
n
T
H
1
=
41. T
herefo
r
e, in o
r
d
e
r t
o
mea
s
u
r
e t
he de
si
red
si
ze of
grai
n,
we
sho
u
ld acco
rding to different image
s chara
c
te
rist
i
c
s sele
ct differe
nt thresh
old
segm
entation
s
to
binary.
Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM
NIKA
e-ISSN:
2087
-278X
Study on the
Method of the
Self-adaptin
g Im
age Thre
shol
d Di
vided
… (Wu Qizho
u
)
6955
(a) 3#gr
ain
(b) 6#gr
ain
Figure 7. Gra
y
Curve of 3#
and 6# G
r
ain
s
To sum up, a
daptive imag
e segm
entati
on
techni
que
is based on t
he mean an
d stand
ard
deviation of
grain fa
ce i
m
age to d
e
termin
e the t
h
re
shol
d. It obtaine
d hig
h
pre
c
i
s
ion,
very
suitabl
e fo
r i
m
age
segme
n
tation of
gra
i
n. Solved th
e key te
chnol
ogie
s
whi
c
h
usin
g the
sca
nne
r
to get the face image of grain to detect the si
ze of ID and O
D
.
Referen
ces
[1]
W
ang Z
h
enh
ai
, W
ang Yuk
u
n
.
T
he Ph
otoel
e
c
trical D
e
tectin
g Syste
m
for
Metal Pl
ate C
l
a
ssificati
on
.
Journ
a
l of Optoel
ectronics.
La
se
r.
199
8; 9(3
)
: 238-24
0.
[2]
Charl
o
C Le
e.
Desig
n
of a Hi
gh Res
o
luti
on
Electron-
optica
l
Scann
ing Sys
t
em
.
SPIE.
199
6; 856-8
61.
[3]
Qiao Ho
ng, Lin
Yue.
Study on
the influe
nce
of the w
o
rk piec
e vibrati
on on
the accuracy of the laser-
scan on
lin
e tes
t
.
Optical T
e
chnol
ogy
. 20
00; 26(2): 15
0-1
5
2
.
[4]
Che
n
Sh
utia
n, Z
hao Y
o
n
g
.
Different M
e
th
ods
on th
e Cy
lindr
ica
l
Inn
e
r
Di
mens
io
n Me
asure
m
ent b
y
Laser Optics
. Appl
ied L
a
ser.
200
0; 20(2): 67
-70.
Evaluation Warning : The document was created with Spire.PDF for Python.