· δ (l p , lq ),
(4)
{ p,q}∈N
p∈P
where N is the set of neighboring pixels and lp represents the label assigned to pixel p. The particular forms for Rp (lp ) are the penalty for assigning label lp to pixel p. The weight of Rp (lp ) can be obtained by comparing the intensity of pixel p with the given histogram of the object and background. The weight of the t-links is defined in the following equations:
R p (1 ) = − ln Pr I p | ob j , R p (0 ) = − ln Pr I p | bkg ,
(5)
(6)
Eqs. (5) and (6) show that when Pr(I p | ob j ) is larger thanPr(I p | bkg ), Rp (1) will be smaller thanRp (0). Thus, when the pixel is more likely to be the object, the penalty for grouping that pixel into object should be smaller, which can reduce the energy in (2). Thus, when all pixels have been separated correctly into two subsets, the regional term will be minimized. B
· δ (l p , lq ) in Eq.(4) is the boundary term, which is defined as the following equations [16]. { p,q}∈N
δ ( l p , lq ) =
1 0
if if
l p = lq l p = lq
(7)
Please cite this article as: W. Wang et al., Image segmentation incorporating double-mask via graph cuts, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.03.003
ARTICLE IN PRESS
JID: CAEE
[m3Gsc;May 10, 2016;15:15]
W. Wang et al. / Computers and Electrical Engineering 000 (2016) 1–9
YCrCb space
Cr-Component
5
Double-mask Segmentation Graph cuts
Fig. 5. Structure of the proposed method.
Fig. 6. Configuration sketch of data collection platform.
(Ip − Iq )2 B
∝ exp − 2σ 2
(8)
The regional constraint can be interpreted as assigning labels lp and lq to neighboring pixels. When neighboring pixels have similar labels, the penalty is 0, which means the regional term would only sum up the penalty at the segmented boundary. σ can be viewed as camera noise. The penalty is only extremely high when the intensity of two neighboring pixel is highly similar, otherwise, the penalty low. Thus, when the energy function obtains the minimum value, energy is more likely to occur at the object boundary. Thus, the minimum energy problem is converted into the graph cuts problem. Based on our discussion in the previous section, we proposed incorporating seeds information selectively based on the needs of the graph construction. We can increase the number of determined labels (L = {l1 , l2 , l3 , · · ·, l p , · · ·l|P| }) to adjust the input in the energy function in Eq. (2). The graph model was constructed in a special area of the original image, and corresponded to the red bounding box by coordinate delivery. In our method, the double-mask provided object and background seeds with the white mask and red bounding box, respectively. In this study, we proposed a new strategy that achieved Cyprinus carpio image segmentation by incorporating doublemask via graph cuts. For the first contribution of the study, a pre-segmentation strategy, which was combined with YCrCb color space segmentation based on Mahalanobis distance, was shown. This approach used the correct object region as mask. Pre-segmentation supplied important data sources for graph cuts. For the second contribution, we proposed the doublemask method to decrease the computational area of graph model significantly. Fig. 5 shows the structure of our proposed method. 3. Experiments 3.1. Platform and data Underwater image data were captured using a data collection platform based on computer vision. The platform comprised five main modules: a water tank, a lamp, an experimental desk, an aerator, a CCD color camera (DH-HV3151UC COMOS), and a PC. The entire device is shown in Fig. 6. The water tank was placed on the experimental desk to maintain the CCD camera at an appropriate height level. The water quality was guaranteed by the aerator. Videos (750 frames each video) were captured by the CCD camera and saved in the PC in AVI format. Cyprinus carpio images were captured using our program, and the resolution of these images is 872 × 436. Some images were selected arbitrarily to test our proposed method. Please cite this article as: W. Wang et al., Image segmentation incorporating double-mask via graph cuts, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.03.003
ARTICLE IN PRESS
JID: CAEE 6
[m3Gsc;May 10, 2016;15:15]
W. Wang et al. / Computers and Electrical Engineering 000 (2016) 1–9
Fig. 7. (a), (e), (h) are samples selected of Cyprinus carpio in different postures. Table 1 Statistical results of OS.
a1 a2 a3 a4 Average
Otsu
PCNN
YUV
Our method
3.12% 1.28% 3.27% 0.35% 2.01%
1.32% 0.96% 0.8% 0.68% 1.02%
75.73% 71.01% 69.33% 54.11% 67.55%
88.16% 87.19% 86.61% 83.26% 86.31%
3.2. Results and analysis Images were selected arbitrarily for our pre-segment approach. Fig. 7 shows the accuracy results of double-mask detection. In these images, the detection windows reduced the size of the graph model, which will be calculated. Double-mask information was transformed into the original image and additional prior constraints were incorporated into the energy function. 3.3. Method comparison We used the pixel-level segmentation overlap score, OS, to quantify accuracy. The quality of the segmented region with respect to ground-truth object segmentation was measured as Eq. 8:
OS =
|GT ∩ R| , |GT ∪ R|
(9)
where GT represents the object region associated with region R’s majority pixel; GT denotes the segmentation regions handled manually by humans. R is our segmentation region. Higher OS gained by the output indicates its higher effectiveness and accuracy. In this section, we analyzed the segmentation results of Otsu, PCNN, and YUV and present their results using collection images (Fig. 8) . The quantity results with respect to the images were shown in Table 1. The accuracy of the Otsu and PCNN segmentations was significantly low. A remarkable feature of the YUV color spaces was revealed. However, Fig. 8(d1−d4) shows that the eyes and some regions were not segmented because of the scale. These problems were addressed by the proposed method based on graph cuts. Table 1 shows that the average accuracy rates of Fig. 8(b–d) were 2.01%, 1.02%, and 67.55%, respectively. Although these methods could segment the object region, the entire Cyprinus carpio segmentation was not implemented precisely. The average accuracy rate of our method was 86.31% in Fig. 8(e). Four videos (750 frames of each video) were selected to count Please cite this article as: W. Wang et al., Image segmentation incorporating double-mask via graph cuts, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.03.003
JID: CAEE
ARTICLE IN PRESS W. Wang et al. / Computers and Electrical Engineering 000 (2016) 1–9
[m3Gsc;May 10, 2016;15:15] 7
Fig. 8. Several results with different segmentation methods.
the execution time. Average execution time was approximately 2.17 s for each image with masks, and average execution time was approximately 6.31 s for each image without masks. Therefore, Cyprinus carpio object segmentation incorporating double-mask via graph cuts was a novel and effective approach. 4. Conclusion and future works A novel and effective image segmentation method based on graph cuts was proposed to extract the Cyprinus carpio target from a complex underwater scene. Experimental results showed that a traditional image segmentation method based on threshold was unsuitable for segmenting the Cyprinus carpio target directly. Good segmentation results might not be achieved because of non-uniform light, blurring, and diminished color in the underwater environment. The remarkable performance of Cyprinus carpio in the Cr component in YCrCb color space was an important cue in our experiments. The first step in our double-mask method was pre-segmentation. Double-mask formation based on graph cuts could effectively improve the performance of the Cyprinus carpio segmentation. Experimental data were insufficient to support the work in this study, resulting in a defect in the comparative advantage of the proposed method. The amount of data from the target mask can be reduced further to improve the efficiency of the algorithm. In future work, we intend to utilize other methods to study several Cyprinus carpio features and extend our method to other kinds of Cyprinus carpio. Experimental platforms will be established to collect depth information on the species. We will also continue searching for more effective and general segmentation approaches to improve our experiments. Acknowledgments This research is financially supported by the Chinese Universities Scientific Fund (2013QJ052), the National Science and Technology Support Program (2011BAD21B01 & 2012BAD35B07), the National Natural Science Foundation of China Please cite this article as: W. Wang et al., Image segmentation incorporating double-mask via graph cuts, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.03.003
JID: CAEE 8
ARTICLE IN PRESS
[m3Gsc;May 10, 2016;15:15]
W. Wang et al. / Computers and Electrical Engineering 000 (2016) 1–9
(61100115, 61472172, 61471133), the Science and Technology Development Plan of Shandong Province (2015GGX101019), Opening Foundation of Engineering Research Center of Digital Media Technology, Ministry of Education (2015AA0 0 02), and the Natural Science Foundation of Shandong Province (ZR2012FM008). References [1] Vicente S, Kolmogorov V, Rother C. Graph cut based image segmentation with connectivity priors. Computer vision and pattern recognition, CVPR; 2008. [2] Boykov Y, Jolly M. Interactive graph cuts for optimal boundary & region segmentation of objects in N-D images. In: International conference on computer vision, vol.1; 2001. p. 105–12. [3] Greig DM, Porteous BT, Seheult AH. Exact maximum a posteriori estimation for binary images. J R Stat Soc, series B (Methodological), 1989;51(2):271–9. [4] Ford LR, Fulkerson DR. Flows in networks. Princeton: Princeton University Press; 1962. [5] Boykov Y, Veksler O, Zabih R. Fast approximate energy minimization via graph cuts. IEEE Trans Pattern Anal Mach Intell 2001;23(11):1222–39. [6] Yuri YB, Lea GF. Graph cuts and efficient N-D image segmentation. Int J Comput Vision 2006;70(2):109–31. [7] Saitoh T, Tamura Y, Kaneko T. Automatic segmentation of liver region based on extracted blood vessels. Syst Comput Japan 2004;35(5):633–41. [8] Tan KS, Mat Isa NA, Lim WH. Color image segmentation using adaptive unsupervised clustering approach. Appl Soft Comput 2013;13:2017–36. [9] Sojar V, Stanisavljev D, Hribernik M, Glui M, Kreuh D, Velkavrh U, Fius T. Liver surgery training and planning in 3D virtual space. In: International Congress Series, 1268(06); 2004. p. 390–4. [10] Kass M, Witkin A, Terzopoulos D. Snakes: active shape models. Int J Comput Vis 1987;1:321–31. [11] Massoptier L, Casciaro S. Fully automatic liver segmentation through graph-cut technique. In: Proceedings of the 29th annual international conference of the IEEE EMBS cité internationale; 2007. p. 23–6. [12] Freedman D, Zhang T. Interactive graph cut based segmentation with shape priors. In: IEEE computer society conference on CVPR, vol. 1; 2005. p. 755–62. [13] Wang H, Zhang H. Adaptive shape prior in graph cut segmentation. In: IEEE international conference on ICIP; 2010. p. 2029–3032. [14] Zhou J, Ye M, Zhang X. Graph cut segmentation with automatic editing for Industrial images. In: Inter conference on ICICIP; 2010. p. 633–7. [15] Wang H, Zhang H, Ray N. Adaptive shape prior in graph cut image segmentation. Pattern Recognit 2013;46:1409–14. [16] Yuri YB, Lea GF. Graph cuts and efficient N-D image segmentation. Int J Comput Vis 2006;70(2):109–31. [17] Zhang C, Feng X, Li L, et al. Identification of cotton contaminants using neighborhood gradient based on YCbCr color space. In: Proceedings of the 2nd international conference on signal processing systems, ICSPS, Vol. 3; 2010. p. 733–8. [18] Yi F, Moon I. Image segmentation: a survey of graph-cut methods. In: Proceedings of the 2012 International Conference on Systems and Informatics (ICSAI 2012); 2012. p. 1936–41.
Please cite this article as: W. Wang et al., Image segmentation incorporating double-mask via graph cuts, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.03.003
JID: CAEE
ARTICLE IN PRESS W. Wang et al. / Computers and Electrical Engineering 000 (2016) 1–9
[m3Gsc;May 10, 2016;15:15] 9
Wencong Wang received his M.E. from the College of Electrical and Information Engineering, China Agricultural University in 2014. His research interest is analysis of animals’ behavior based on computer vision. He is currently a patent examiner at Patent Examination Cooperation Jiangsu Center of The Patent Office, SIPO. Dr. Zhenbo Li received his Ph.D degrees from the Institute of Computing Technology, Chinese Academy of Sciences, China in 2007. He is an associate professor at College of Information and Electrical Engineering Department, China Agricultural University, China. His research interests are computer vision, computer graphics, and information management in agriculture. Prof. Jun Yue received her Ph.D from College of Economics & Management, China Agricultural University, China in 2007. She is an professor in College of Information and Electrical Engineering Department, LuDong University, China. Her research interests are cross media retrieval, sematic web. Prof. Daoliang Li received his Ph.D from Engineering College, China Agricultural University China in 1999. He is a professor at College of Information and Electrical Engineering Department, China Agricultural University, China. His research interest is information processing in agriculture.
Please cite this article as: W. Wang et al., Image segmentation incorporating double-mask via graph cuts, Computers and Electrical Engineering (2016), http://dx.doi.org/10.1016/j.compeleceng.2016.03.003