基于双摄像头信息互补的牛只体尺测量算法

  • 蓝雷斌 ,
  • 沈雷 ,
  • 方一昊 ,
  • 黄安祥
展开
  • 杭州电子科技大学通信工程学院,浙江 杭州 310018
蓝雷斌(1999-),男,硕士研究生,研究方向:数字图像处理。E-mail:2475119719@qq.com。
沈雷,教授,研究方向:数字图像处理、模式识别。E-mail:shenlei@hdu.edu.cn。

收稿日期: 2023-05-04

  网络出版日期: 2025-01-13

Cattle body size measuring algorithms based on the complementary information of dual cameras

  • LAN Leibin ,
  • SHEN Lei ,
  • FANG Yihao ,
  • HUANG Anxiang
Expand
  • School of Communication Engineering, Hangzhou Dianzi University, Hangzhou Zhejiang 310018, China

Received date: 2023-05-04

  Online published: 2025-01-13

摘要

目前基于计算机视觉的畜禽体尺测量方法主要是采用图像处理技术对单一的畜禽完整侧身图像进行分析处理,计算所需测点坐标,根据标定参数计算出畜禽的体尺数据。但是此类方法对于畜禽侧身图像的质量要求比较严苛,当图像中畜禽的局部侧身部位缺失时,会导致此类体尺测量方法难以应用。本文提出一种基于双摄像头信息互补的视觉三角身高测量算法和相似三角体直长测量算法。首先通过正上方摄像头与侧方摄像头的双视角图像信息互补来弥补单幅二维图像中缺少景深信息的不足,同时使用YOLOV5算法和凸包角点检测算法从牛背俯视图进行肩胛-尾尻测点提取。视觉三角身高测量算法通过上方摄像头获得牛只肩胛部位与侧方摄像头的相对水平距离,结合侧方摄像头中辅助标尺下端坐标的实际高度,基于相似三角形原理计算牛只身高。相似三角体直长测量算法利用牛只身高数据计算正上方摄像头画面中对应牛背的景深,然后结合景深信息、肩胛测点和尾尻测点之间的欧氏距离、上方摄像头对地空间分辨率,来计算牛只体直长。所提算法解决了不能获取到完整牛只侧身图像情况下的体尺测量问题。对30头牛进行体尺测量,正常情况下牛只身高测量平均误差为2.25%,体直长测量平均误差为3.33%;在相对拥挤情况下牛只身高测量平均误差为3.03%,体直长测量平均误差为3.68%。

本文引用格式

蓝雷斌 , 沈雷 , 方一昊 , 黄安祥 . 基于双摄像头信息互补的牛只体尺测量算法[J]. 杭州电子科技大学学报, 2024 , 44(6) : 11 -19 . DOI: 10.13954/j.cnki.hdu.2024.06.002

Abstract

At present, computer vision based methods for measuring the body size of livestock and poultry mainly use image processing technique to analyze and process a single complete side image of livestock and poultry, calculate the required measurement point coordinates, and calculate the required body size data based on calibration parameters. However, such methods have strict requirements for the quality of side body images of livestock and poultry. When local side parts of livestock and poultry are missing in the images, it will make it difficult to apply such body size measurement methods. This paper proposes a visual triangle height measurement algorithm and a similar triangle length measurement algorithm based on dual camera information complementarity. Firstly, the proposed algorithm compensates for the lack of depth of field information in a single two-dimensional image by using the dual view image information of the overhead camera and the side camera to complement each other. At the same time, the YOLOV5 algorithm and convex hull corner detection algorithm are used for shoulder and tail measurement points extraction with the top view of the cow's back. The proposed algorithm obtains the relative horizontal distance between the shoulder blade of the cow and the side camera through the upper camera, and calculates the cow's height based on the principle of similar triangles, combined with the actual height of the lower coordinate of the auxiliary scale in the side camera. The proposed algorithm for measuring the straight length of similar triangles uses cow height data to calculate the depth of field corresponding to the cow's back in the directly above camera image. Then, it combines the depth of field information, the Euclidean distance between the shoulder and tail measurement points, and the spatial resolution of the above camera to the ground to calculate the straight length of the cow. It solves the measurement problem problem of body size in the case that the complete side image of cattle can not be obtained. The body size of 30 cattle is measured. Under normal circumstances, the average error of cattle height measurement is 2.25%, and the average error of body length measurement is 3.33%; the average error in height measurement of cows under relatively crowded conditions is 3.03%, and the average error in body length measurement is 3.68%.

参考文献

[1]Khojastehkey M, Aslaminejad A A, Shariati M M, et al. Body size estimation of new born lambs using image processing and its effect on the genetic gain of a simulated population[J]. Journal of Applied Animal Research, 2016,44(1):326-330.
[2]江杰,岳伟,曹孟珍.基于机器视觉的羊体体尺测量方法研究[J].包头:内蒙古科技大学学报,2015,34(4):322-327.
[3]石炜,张帅奇.基于边缘的图像分割在牛体尺测量中的应用[J].数字技术与应用,2020,38(2):48-51.
[4]张丽娜.基于跨视角机器视觉的羊只体尺参数测量方法研究[D].呼和浩特:内蒙古农业大学,2017.
[5]刘伟.基于深度学习的牛体尺测量方法研究[D].包头:内蒙古科技大学,2020.
[6]刘卫民.基于机器视觉的奶牛体尺参数测量研究[D].泰安:山东农业大学,2016.
[7]JOCHER G. (2020). YOLOv5 by Ultralytics (Version 7.0) [Computer software]. https://doi.org /10.5281/zenodo.3908559.
[8]曾建华,黄时杰.典型图像边缘检测算子的比较与分析[J].河北师范大学学报(自然科学版),2020,44(4):295-301.
[9]HARRIS C, STEPHENS M. A combined corner and edge detector[C]//Proceedings of the Alvey Vision Conference 1988. Manchester. Alvey Vision Club, 1988:147-152.
[10]SHI J B, TOMASI. Good features to track[C]//1994 Proceedings of IEEE Conference on Computer Vision and Pattern Recognition. Seattle, WA, USA. IEEE, 1994:593-600.
[11]ALEXEY D, LUCAS B, ALEXANDER K, et al. An image is worth 16×16 words: transformers for image recognition at scale[EB/OL]. (2020-10-22)[2023-05-04]. https://arxiv.org/abs/2010.11929.
文章导航

/

〈 〉