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

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%.

Cite this article

LAN Leibin , SHEN Lei , FANG Yihao , HUANG Anxiang . Cattle body size measuring algorithms based on the complementary information of dual cameras[J]. Journal of Hangzhou Dianzi University, 2024 , 44(6) : 11 -19 . DOI: 10.13954/j.cnki.hdu.2024.06.002

References

[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.
Outlines

/

〈 〉