《计算机应用》唯一官方网站 ›› 2022, Vol. 42 ›› Issue (5): 1598-1606.DOI: 10.11772/j.issn.1001-9081.2021030532

• 多媒体计算与计算机仿真 • 上一篇    下一篇

基于Kinect v4的牛体尺测量方法

赵建敏(), 赵成, 夏海光   

  1. 内蒙古科技大学 信息工程学院,内蒙古 包头 014010
  • 收稿日期:2021-04-08 修回日期:2021-06-30 接受日期:2021-06-30 发布日期:2022-06-11 出版日期:2022-05-10
  • 通讯作者: 赵建敏
  • 作者简介:赵建敏(1982—),男,内蒙古包头人,副教授,硕士,主要研究方向:图像处理、机器学习 zhao_jm@imust.edu.cn
    赵成(1997—),男,天津人,硕士研究生,主要研究方向:计算机视觉、图像处理
    夏海光(1981—),男,内蒙古赤峰人,助理研究员,硕士,主要研究方向:图像处理。
  • 基金资助:
    内蒙古自治区科技重大专项(2019ZD025);内蒙古自治区自然科学基金资助项目(2019LH06006);包头市昆区科学技术发展项目(YF2020014)

Cattle body size measurement method based on Kinect v4

Jianmin ZHAO(), Cheng ZHAO, Haiguang XIA   

  1. School of Information Engineering,Inner Mongolia University of Science and Technology,Baotou Inner Mongolia 014010,China
  • Received:2021-04-08 Revised:2021-06-30 Accepted:2021-06-30 Online:2022-06-11 Published:2022-05-10
  • Contact: Jianmin ZHAO
  • About author:ZHAO Jianmin, born in 1982,M. S.,associate professor. Hisresearch interests include image processing,machine learning.
    ZHAO Cheng, born in 1997, M. S. candidate. His researchinterests include computer vision,image processing.
    XIA Haiguang, born in 1981,M. S.,assistant research fellow. Hisresearch interests include image processing.
  • Supported by:
    Major Science and Technology Special Project of Inner Mongolia Autonomous Region(2019ZD025);Natural Science Foundation of Inner Mongolia Autonomous Region(2019LH06006);Science and Technology Development Project of Kunqu District, Baotou City(YF2020014)

摘要:

针对基于机器视觉的牛体尺测量方法中图像背景复杂、特征点提取难度大的问题,提出了一种基于Kinect v4传感器的牛体尺测量方法来采集彩色和深度图像,并结合目标检测、Canny边缘检测、三点圆弧曲率等算法提取体征特征点进而计算体尺数据。首先,制作了牛体尺特征部位图像数据集,并利用深度学习YOLOv5目标检测算法检测牛体尺特征部位信息,以减少牛体其他部位和背景对体尺测点提取的干扰;其次,借助OpenCV图像处理库中的Canny边缘检测、轮廓提取等图像处理算法获取牛体尺测点所在的关键轮廓;然后,对关键轮廓采用多项式拟合和三点圆弧曲率等算法从而在二维图像中提取牛体尺测点;最后,利用深度信息将二维图像中的测点信息转换到三维坐标系下,并结合随机抽样一致(RANSAC)算法在三维坐标系下设计牛体尺测量方法。经过在复杂环境下传感器和牛体侧面成不同偏角时的实验测量结果和人工测量结果的比较得出,牛体尺数据中鬐甲高的平均相对误差为0.76%,体斜长的平均相对误差为1.68%,体直长的平均相对误差为2.14%,臀端高的平均相对误差为0.76%。实验结果表明,所提方法在复杂环境下具有较高的测量精度。

关键词: 牛, 体尺测量, 目标检测, 图像处理, Kinect传感器, 深度信息

Abstract:

Aiming at the complexity of image background and difficulty of feature point extraction in cattle body size measurement based on machine vision, a new cattle body size measurement method based on Kinect v4 sensor was proposed. In this method, the color and depth images were collected, and the body size data were calculated by the body feature points extracted by the combination of algorithms such as object detection, Canny edge detection, and three-point arc curvature. Firstly, an image dataset of feature parts of cattle body size was created, and the deep learning You Only Look Once v5 (YOLOv5) target detection algorithm was used to detect feature part information of cattle body size in order to reduce the interference of other parts of cattle body and background on the extraction of body size measuring points. Secondly, with the help of Canny edge detection, contour extraction and other image processing algorithms in Open source Computer Vision (OpenCV) image processing library, the key contours with measuring points of cattle body size were obtained. Then, the algorithms such as polynomial fitting and three-point arc curvature were performed on the key contours to extract the measuring points of cattle body size in two-dimensional image. Finally, the depth information was used to convert the measuring point information in two-dimensional image to three-dimensional coordinate system, and the cattle body size measurement method was designed in three-dimensional coordinate system with the RANdom SAmple Consensus (RANSAC) algorithm. Through the comparison between the experimental measurement results with the sensor and the side of cattle body at different angles and manual measurement results in a complex environment, it can be seen that the average relative error of withers height is 0.76%, the average relative error of body oblique length is 1.68%, the average relative error of body straight length is 2.14 %, and the average relative error of hip height is 0.76% in cattle body measurement data. Experimental results show that the proposed method has high measurement accuracy in complex environment.

Key words: cattle, body size measurement, target detection, image processing, Kinect sensor, depth information

中图分类号: