Automatic measurement of morphological indexes of three Thunnus species based on computer vision
-
摘要: 金枪鱼类是我国远洋渔业重要的捕捞对象,其形态指标对研究金枪鱼类的生长、发育和生活史具有重要意义。人工测量形态指标是一种非常繁琐且低效率的测量方法,而计算机视觉是一种高效和客观的自动测量方法。因此,本文通过计算机视觉库OpenCV对3种金枪鱼类图像进行预处理,主要利用双边滤波、灰度变换、二值化处理和提取轮廓等图像处理技术得到金枪鱼类形态轮廓图像。根据预先选定的特征点,利用计算机视觉技术遍历轮廓图像上所有的像素点,并自动定位出每张轮廓图像的预选特征点共17个。利用计算机视觉技术遍历得到的特征点位置,自动测量出3种金枪鱼的形态指标像素长度,并计算出形态指标实际长度。还分析自动测量与人工测量形态指标的绝对误差和相对误差。研究结果表明,通过计算机视觉技术对3种金枪鱼的形态指标的自动测量效果较好,大眼金枪鱼、黄鳍金枪鱼和长鳍金枪鱼的12个形态指标的绝对误差范围分别为0~1.46 cm、0~1.73 cm、0~1.32 cm,其相对误差范围分别为0.01%~5.84%、0%~6.17%、0%~6.89%。本研究以期为金枪鱼类智能识别提供前期工作基础,也为其他鱼类自动测量研究提供基础参考。Abstract: Tuna is an important fishing target in China’s pelagic fishery. Its morphological indexes are of great significance for the study of the growth, development and life history of tunas. Manual measurement of morphological index is a very tedious and inefficient measurement method, while computer vision is an efficient and objective automatic measurement method. Therefore, in this paper, images of three Thunnus species are preprocessed by the computer vision library (OpenCV). It mainly uses image processing techniques such as bilateral filter, gray transformation, image binarization and contour extraction to obtain the contour image of tuna. According to the pre-selected feature points, the computer vision technology is used to traversal all the pixel points on the contour image, and 17 pre-selected feature points of each contour image are automatically located. By using the computer vision technology, the pixel length of the morphological index of the three species of tuna is automatically measured and the actual length of the morphological index is calculated. The absolute error and relative error between automatic measurement and manual measurement are compared and analyzed. The results show that the computer vision technique is effective in the automatic measurement of the morphological indexes of the three Thunnus species. The absolute error ranges of 12 morphological indices of Thunnus obesus, Thunnus albacores and Thunnus alalunga are 0.00−1.46 cm, 0−1.73 cm and 0−1.32 cm, respectively, and the relative error ranges are 0.01%−5.84%, 0%−6.17% and 0%−6.89%, respectively. It is expected to provide a basis for intelligent identification of tuna and a basic reference for automatic measurement of other fish.
-
Key words:
- computer vision /
- Thunnus /
- morphological contour /
- feature points /
- morphological indexes /
- automatic measurement
-
图 7 形态指标的绝对误差均值
1. 全长;2. 体长;3. 体高;4. 尾鳍宽;5. 第二背鳍长;6. 第二背鳍基底长;7. 臀鳍长;8. 臀鳍基底长;9. 尾柄高;10. 头一鳍长;11. 头二鳍长;12. 头臀鳍长
Fig. 7 Absolute error mean of morphological index
1: Total length, 2: standard length; 3. body height; 4. caudal fin width; 5. second dorsal fin length; 6. second dorsal fin base length; 7. andl fin length; 8. andl fin base length; 9. caudal peduncle height; 10. distance of the first dorsal fin; 11. distance of the second dorsal fin; 12. distance of anal fin
图 8 形态指标的相对误差均值
1. 全长;2. 体长;3. 体高;4. 尾鳍宽;5. 第二背鳍长;6. 第二背鳍基底长;7. 臀鳍长;8. 臀鳍基底长;9. 尾柄高;10. 头一鳍长;11. 头二鳍长;12. 头臀鳍长
Fig. 8 Relative error mean of morphological index
1: Total length, 2: standard length; 3. body height; 4. caudal fin width; 5. second dorsal fin length; 6. second dorsal fin base length; 7. andl fin length; 8. andl fin base length; 9. caudal peduncle height; 10. distance of the first dorsal fin; 11. distance of the second dorsal fin; 12. distance of anal fin
表 1 特征点定义和定位
Tab. 1 Definition and location of feature points
特征点 定义 定位 1a 鱼吻下吻端点 遍历图像跟踪到鱼吻下吻处最左点 1b 鱼吻上吻端点 遍历图像跟踪到鱼吻上吻处最左点,其中若鱼嘴呈闭合状态,则1a点和1b点重合 2 尾鳍上半部分端点 遍历上半张图像跟踪到鱼类轮廓最右点 3 尾鳍下半部分端点 遍历下半张图像跟踪到鱼类轮廓最右点 5 第一背鳍端点 取1b点和2点的横坐标的中间值为边界,遍历左半张图,跟踪到鱼类轮廓最高点 6 腹鳍端点 取1b点和2点的横坐标的中间值为边界,遍历左半张图,跟踪到鱼类轮廓最低点 8 尾鳍上半部分前端与鱼体的连接点 取2点和5点的横坐标为边界划分的区间,遍历鱼类轮廓上半部分跟踪到最低点 9 尾鳍下半部分前端与鱼体的连接点 取3点和5点的横坐标为边界划分的区间,遍历鱼类轮廓下半部分跟踪到最高点 10 尾鳍后部其上部分与下部交点 取8点纵坐标及9点纵坐标为边界划分的区间,遍历鱼类轮廓右半部分跟踪到最左点 12 第二背鳍前端与鱼体的连接点 遍历第一背鳍与第二背鳍之间的轮廓跟踪到最低点 4 第二背鳍端点 取12点和8点的横坐标为边界划分区间,遍历鱼类轮廓上半部分跟踪到最高点 7 臀鳍端点 取1b点和2点横坐标的中间值及2点和4点横坐标的中间值为边界划分的区间,遍历鱼类轮廓下半部分跟踪到最低点 11 第一背鳍前端与鱼体的连接点 遍历鱼类轮廓左上部分,跟踪到距离1b点和5点连线最远点 13 第二背鳍后端与鱼体的连接点 遍历鱼类轮廓右上部分,跟踪到距离4点和8点连线最远点 15 臀鳍前部与鱼体的连接点 取6点和7点横坐标中间值,在取这个中间值位于鱼类形态轮廓上的点与7点连线跟踪到距离最远点 14 腹鳍前部与鱼体的连接点 遍历鱼类轮廓左下部分,跟踪到腹鳍前部与鱼体的连接点 16 臀鳍后部与鱼体的连接点 遍历鱼类轮廓右下半部分跟踪到距离7点和9点连线最远点 表 2 形态指标均值
Tab. 2 Mean of morphological index
种 全长/cm 体长/cm 体高/cm 尾鳍宽/cm 第二背鳍长/cm 第二背鳍
基底长/cm臀鳍长/cm 臀鳍基底长/cm 尾柄高/cm 头一鳍长/cm 头二鳍长/cm 头臀鳍长/cm 大眼金枪鱼 74.24 62.71 19.96 23.17 8.16 4.77 7.60 3.81 2.34 22.62 39.43 43.99 黄鳍金枪鱼 68.90 57.38 16.18 19.68 7.84 4.65 7.48 4.25 2.16 19.97 34.77 38.02 长鳍金枪鱼 104.50 87.14 24.66 35.51 11.50 6.61 13.01 6.54 3.20 29.24 52.32 58.27 表 3 3种金枪鱼属的绝对误差范围
Tab. 3 Absolute error range of three Thunnus species
种 全长/cm 体长/cm 体高/cm 尾鳍宽/cm 第二背鳍长/cm 第二背鳍基底长/cm 大眼金枪鱼 0.01~1.02 0.03~0.80 0.09~0.83 0~0.58 0.01~0.34 0.01~0.14 黄鳍金枪鱼 0.08~1.23 0~1.73 0~0.33 0.01~0.13 0.01~0.17 0.01~0.24 长鳍金枪鱼 0~1.32 0.10~1.30 0~0.67 0~0.59 0.01~0.15 0.02~0.20 种 臀鳍长/cm 臀鳍基底长/cm 尾柄高/cm 头一鳍长/cm 头二鳍长/cm 头臀鳍长/cm 大眼金枪鱼 0.04~0.29 0.01~0.18 0.01~0.07 0.01~0.68 0.01~0.91 0.01~1.46 黄鳍金枪鱼 0~0.42 0.01~0.10 0~0.16 0~1.09 0.01~0.45 0.02~0.43 长鳍金枪鱼 0.01~0.32 0.01~0.41 0.01~0.10 0.14~0.93 0.13~0.51 0.02~0.84 表 4 3种金枪鱼属的相对误差范围
Tab. 4 Relative error range of three Thunnus species
种 全长 体长 体高 尾鳍宽 第二背鳍长 第二背鳍基底长 大眼金枪鱼 0.01%~1.07% 0.05%~1.13% 0.51%~2.38% 0.02%~1.66% 0.22%~3.69% 0.19%~2.74% 黄鳍金枪鱼 0.14%~1.21% 0%~1.80% 0.01%~2.14% 0.04%~0.82% 0.14%~1.91% 0.16%~4.78% 长鳍金枪鱼 0%~1.33% 0.13%~1.49% 0%~2.95% 0.01%~1.86% 0.05%~1.29% 0.36%~3.52% 种 臀鳍长 臀鳍基底长 尾柄高 头一鳍长 头二鳍长 头臀鳍长 大眼金枪鱼 0.84%~3.59% 0.16%~5.84% 0.24%~3.63% 0.03%~2.98% 0.02%~2.66% 0.02%~3.33% 黄鳍金枪鱼 0.06%~2.83% 0.33%~2.42% 0.08%~6.71% 0.03%~3.55% 0.02%~0.83% 0.04%~1.28% 长鳍金枪鱼 0.08%~3.15% 0.13%~6.89% 0.13%~4.24% 0.29%~2.97% 0.21%~0.96% 0.02%~1.48% -
[1] 崔雍浩, 商聪, 陈锶奇, 等. 人工智能综述: AI的发展[J]. 无线电通信技术, 2019, 45(3): 225−231. doi: 10.3969/j.issn.1003-3114.2019.03.01Cui Yonghao, Shang Cong, Chen Siqi, et al. Overview of AI: developments of AI techniques[J]. Radio Communications Technology, 2019, 45(3): 225−231. doi: 10.3969/j.issn.1003-3114.2019.03.01 [2] Fernandesa A F A, Turrab E M, de Alvarengab É R, et al. Deep learning image segmentation for extraction of fish body measurements and prediction of body weight and carcass traits in Nile tilapia[J]. Computers and Electronics in Agriculture, 2020, 170: 105274. doi: 10.1016/j.compag.2020.105274 [3] Islamadina R, Pramita N, Arnia F, et al. Estimating fish weight based on visual captured[C]//2018 International Conference on Information and Communications Technology (ICOIACT). Yogyakarta, Indonesia: IEEE, 2018. [4] Spampinato C, Chen-Burger Y H, Nadarajan G, et al. Detecting, Tracking and Counting Fish in Low Quality Unconstrained Underwater Videos[C]// VISAPP 2008: Proceedings of the Third International Conference on Computer Vision Theory and Applications, Portugal: VISAPP, 2008. [5] Rathi D, Jain S, Indu S. Underwater fish species classification using convolutional neural network and deep learning[C]//2017 Ninth International Conference on Advances in Pattern Recognition (ICAPR). Bangalore, India: IEEE, 2017: 1−6. [6] Li Lian, Hong Jinqi. Identification of fish species based on image processing and statistical analysis research[C]//2014 IEEE International Conference on Mechatronics and Automation. Tianjin, China: IEEE, 2014: 1155−1160. [7] Malik S, Kumar T, Sahoo A K. Image processing techniques for identification of fish disease[C]//2017 IEEE 2nd International Conference on Signal and Image Processing (ICSIP). Singapore: IEEE, 2017: 55−59. [8] 欧利国, 刘必林. 南海东沙群岛海域圆鲹属鱼类矢耳石的形态特征分析[J]. 南方水产科学, 2019, 15(3): 33−40. doi: 10.12131/20180248Ou Liguo, Liu Bilin. Sagittae morphology of genus Decapterus from Dongsha Islands in South China Sea[J]. South China Fisheries Science, 2019, 15(3): 33−40. doi: 10.12131/20180248 [9] 胡祝华, 曹路, 张逸然, 等. 基于计算机视觉的卵形鲳鲹眼部特征检测方法研究[J]. 渔业现代化, 2017, 44(4): 15−23. doi: 10.3969/j.issn.1007-9580.2017.04.003Hu Zhuhua, Cao Lu, Zhang Yiran, et al. Study on eye feature detection method of Trachinotus ovatus based on computer vision[J]. Fishery Modernization, 2017, 44(4): 15−23. doi: 10.3969/j.issn.1007-9580.2017.04.003 [10] Hsieh C L, Chang H Y, Chen F H, et al. A simple and effective digital imaging approach for tuna fish length measurement compatible with fishing operations[J]. Computers and Electronics in Agriculture, 2011, 75(1): 44−51. doi: 10.1016/j.compag.2010.09.009 [11] Balaban M O, Ünal Şengör G F, Soriano M G, et al. Using image analysis to predict the weight of Alaskan salmon of different species[J]. Journal of Food Science, 2010, 75(3): E157−E162. doi: 10.1111/j.1750-3841.2010.01522.x [12] Strachan N J C. Length measurement of fish by computer vision[J]. Computers and Electronics in Agriculture, 1993, 8(2): 93−104. doi: 10.1016/0168-1699(93)90009-P [13] Han J, Honda N, Asada A, et al. Automated acoustic method for counting and sizing farmed fish during transfer using DIDSON[J]. Fisheries Science, 2009, 75(6): 1359−1367. doi: 10.1007/s12562-009-0162-5 [14] 陈新军, 冯波, 许柳雄. 印度洋大眼金枪鱼栖息地指数研究及其比较[J]. 中国水产科学, 2008, 15(2): 269−278. doi: 10.3321/j.issn:1005-8737.2008.02.011Chen Xinjun, Feng Bo, Xu Liuxiong. A comparative study on habitat suitability index of bigeye tuna, Thunnus obesus in the Indian Ocean[J]. Journal of Fishery Sciences of China, 2008, 15(2): 269−278. doi: 10.3321/j.issn:1005-8737.2008.02.011 [15] 王锡昌, 刘燕, 刘源. 大目金枪鱼块温盐水−冷藏库组合解冻工艺的优化[J]. 农业工程学报, 2010, 26(7): 358−363. doi: 10.3969/j.issn.1002-6819.2010.07.063Wang Xichang, Liu Yan, Liu Yuan. Optimization of salt water-cold storage combined thawing technology of big-eye tuna chunk[J]. Transactions of the CSAE, 2010, 26(7): 358−363. doi: 10.3969/j.issn.1002-6819.2010.07.063 [16] 陈新军, 许柳雄, 宋利明, 等. 大西洋海域大眼金枪鱼年龄与生长的初步研究[J]. 海洋渔业, 2006, 28(1): 20−24. doi: 10.3969/j.issn.1004-2490.2006.01.004Chen Xinjun, Xu Liuxiong, Song Liming, et al. Age and growth of bigeye tuna (Thunnus alalunga) in the Atlantic Ocean[J]. Marine Fisheries, 2006, 28(1): 20−24. doi: 10.3969/j.issn.1004-2490.2006.01.004 [17] Muñoz-Benavent P, Andreu-García G, Valiente-González J M, et al. Automatic Bluefin Tuna sizing using a stereoscopic vision system[J]. ICES Journal of Marine Science, 2018, 75(1): 390−401. doi: 10.1093/icesjms/fsx151 [18] 梁广顺, 汪日伟, 温显斌. 基于双边滤波与非局部均值的图像去噪研究[J]. 光电子·激光, 2015, 26(11): 2231−2235.Liang Guangshun, Wang Riwei, Wen Xianbin. Image denoising based on bilateral filtering and non-local means[J]. Journal of Optoelectronics·Laser, 2015, 26(11): 2231−2235. [19] 李晓莎, 林森. 基于Python+OpenCV的车牌识别技术的研究[J]. 数字技术与应用, 2019, 37(6): 95−97.Li Xiaosha, Lin Sen. Research on license plate recognition technology based on Python+OpenCV[J]. Digital Technology and Application, 2019, 37(6): 95−97. [20] 赵世峰, 何皙健. 基于OpenCV的复杂环境下图像二值化方法[J]. 电子测量技术, 2018, 41(6): 55−59.Zhao Shifeng, He Xijian. Binarization method for images acquired under complex environment based on OpenCV[J]. Electronic Measurement Technology, 2018, 41(6): 55−59. [21] 度国旭. OPENCV轮廓识别研究与实践[J]. 装备制造技术, 2020(1): 101−103, 131. doi: 10.3969/j.issn.1672-545X.2020.01.026Duo Guoxu. Research and practice of OpenCV contour recognition[J]. Equipment Manufacturing Technology, 2020(1): 101−103, 131. doi: 10.3969/j.issn.1672-545X.2020.01.026 [22] Tičina V, Grubišić L, Šegvić Bubić T, et al. Biometric characteristics of small Atlantic bluefin tuna (Thunnus thynnus, Linnaeus, 1758) of Mediterranean Sea origin[J]. Journal of Applied Ichthyology, 2011, 27(4): 971−976. doi: 10.1111/j.1439-0426.2011.01752.x [23] Hajjej G, Hattour A, Hajjej A, et al. Biometry, length-length and length-weight relationships of little tuna Euthynnus alletteratus in the Tunisian waters[J]. Journal of Fisheries and Aquatic Science, 2011, 6(3): 256−263. doi: 10.3923/jfas.2011.256.263 [24] 桂弢. 点到直线距离公式的研究性学习成果[J]. 数学通报, 2018, 57(1): 47−49, 56. doi: 10.3969/j.issn.0583-1458.2018.01.010Gui Tao. The research learning result of point-to-line distance formula[J]. Journal of Mathematics (China), 2018, 57(1): 47−49, 56. doi: 10.3969/j.issn.0583-1458.2018.01.010 [25] 余心杰, 吴雄飞, 王建平, 等. 基于机器视觉的大黄鱼形态参数快速检测方法[J]. 集成技术, 2014, 3(5): 45−51.Yu Xinjie, Wu Xiongfei, Wang Jianping, et al. Rapid detecting method for Pseudosciaena crocea Morphological parameters based on the machine vision[J]. Journal of Integration Technology, 2014, 3(5): 45−51. [26] 靳明, 宋建中. 一种自适应的图像双边滤波方法[J]. 光电工程, 2004, 31(7): 65−68, 72.Jin Ming, Song Jianzhong. An adaptive bilateral filtering method for image processing[J]. Opto-Electronic Engineering, 2004, 31(7): 65−68, 72. [27] 余章明, 张元, 廉飞宇, 等. 数字图像增强中灰度变换方法研究[J]. 电子质量, 2009(6): 18−20. doi: 10.3969/j.issn.1003-0107.2009.06.008Yu Zhangming, Zhang Yuan, Lian Feiyu, et al. A research of gray-scale transformation based on digital image enhancement[J]. Electronics Quality, 2009(6): 18−20. doi: 10.3969/j.issn.1003-0107.2009.06.008 [28] 王茜蒨, 彭中, 刘莉. 一种基于自适应阈值的图像分割算法[J]. 北京理工大学学报, 2003, 23(4): 521−524. doi: 10.3969/j.issn.1001-0645.2003.04.030Wang Qianqian, Peng Zhong, Liu Li. An adaptive method of image segmentation[J]. Transaction of Beijing Institute of Technology, 2003, 23(4): 521−524. doi: 10.3969/j.issn.1001-0645.2003.04.030 [29] 戴小杰, 许柳雄, 朱江峰, 等. 世界金枪鱼渔业渔获物物种原色图鉴[M]. 北京: 海洋出版社, 2007: 1-266.Dai Xiaojie, Xu Liuxiong, Zhu Jiangfeng, et al. An Illustrated Book of Primary Colors of World Tuna Fishery Catch Species[M]. Beijing: China Ocean Press, 2007: 1−266. [30] 王奕文, 罗戎蕾, 康宇哲. 基于卷积神经网络的汉服关键尺寸自动测量[J]. 纺织学报, 2020, 41(12): 124−129.Wang Yiwen, Luo Ronglei, Kang Yuzhe. Automatic measurement of key dimensions for Han-style costumes based on use of convolutional neural network[J]. Journal of Textile Research, 2020, 41(12): 124−129. [31] 杨杰超, 许江淳, 陆万荣, 等. 基于计算机视觉的大黄鱼体尺测算与体质量估测[J]. 中国农机化学报, 2018, 39(6): 66−70.Yang Jiechao, Xu Jiangchun, Lu Wanrong, et al. Computer vision-based body size measurement and weight estimation of large yellow croaker[J]. Journal of Chinese Agricultural Mechanization, 2018, 39(6): 66−70. -