基于机器视觉的猪体体尺测点提取算法与应用

    Extraction algorithms and applications of pig body size measurement points based on computer vision

    • 摘要: 无应激获取猪体的体尺、体质量,是猪福利养殖中的一个重要任务,为解决机器视觉提取自然站立姿态下猪体的体尺测点识别率低的问题,该文通过在线摄像机获取120 d龄长白猪的彩色图像,以猪体体尺传统的测量位置为研究基础,结合猪舍现场实际情况,提出了复杂背景下猪体个体信息提取的算法、基于包络分析的猪体头部和尾部的去除算法以及具有一定弯曲姿态的复杂猪体体尺测点坐标提取的算法,并利用Matlab2010软件实现了其算法。验证试验结果表明:通过背景减法和去除噪声算法可去除背景干扰,有效识别猪体信息;测点提取算法可准确提取自然姿态下猪的个体轮廓,识别其体尺测点,实现了猪体的体长、体宽等体尺量算的9个体尺测点的坐标提取,经验证,对猪体体长的实测值平均相对误差最小,其平均相对误差仅为0.92%;其次为腹部体宽,其平均相对误差为1.39%;而对猪体肩宽和臀宽的检测误差较大,平均相对误差分别为2.75%和3.03%。本研究可应用于猪体无应激量算体尺、估算猪体体质量,为开展福利养殖提供了一种新方法。

       

      Abstract: Abstract: It is an essential task to obtain the pig's body size and its weight without stress in the animal welfare farming. In this paper, a new method is proposed which can be applied to calculate pig body width and body length with no stress, and further to estimate the pig body weight. First, an on-line camera as the image acquisition device was used to acquire the back image and the background image of the 120 days old Landrace sow in a local pig farm. The acquired image size is 704 pixels × 576 pixels in the pixel coordinate system. In light of the site conditions of pig house, the background information is removed via arithmetic operation based on gray process of the pig body image and the background image. And image noise is removed by the median filtering method, and detailed porcine somatic information is obtained. Then, the pig body image's segmentation threshold is determined using dynamic threshold method, and the binary image is acquired; After calculating the number and the area of connected regions, the other pigs which may exist in the imaging area get removed via maximum ordinate-area method. Finally, the individual pig contour is extracted through the Canny edge detection algorithm. Because of the interference of the pig head and tail regions with the body size extraction, the identification algorithm aiming at removing head and tail regions in the image is designed, and the data envelopment analysis is used in the algorithm, based on the distance between the body contour and the envelope line, the pig body contour with the head and tail removed is finally obtained. After that, with account of the traditional measuring positions of individual body size, the extraction algorithm for extracting the individual body size with a certain complex curvature is further designed by obtaining the coordinate values of measuring points. The algorithm stability and the extraction accuracy of the verification were tested using 9 different pig images. The result shows that the identification accuracy of pig body size measuring points is 100%, the detection accuracy of the pig body length is high, and the average relative error of the detection values and measured values is 0.92%; The average relative error of abdominal body width is 1.39%, and the average relative errors of shoulder width and hip width are 2.75% and 3.03%, respectively. Overall, the algorithm has a better detection effect for pig body size, and it is stable with better robustness.

       

    /

    返回文章
    返回