宋怀波, 李通, 姜波, 吴倩, 何东健. 基于Horn-Schunck光流法的多目标反刍奶牛嘴部自动监测[J]. 农业工程学报, 2018, 34(10): 163-171. DOI: 10.11975/j.issn.1002-6819.2018.10.020
    引用本文: 宋怀波, 李通, 姜波, 吴倩, 何东健. 基于Horn-Schunck光流法的多目标反刍奶牛嘴部自动监测[J]. 农业工程学报, 2018, 34(10): 163-171. DOI: 10.11975/j.issn.1002-6819.2018.10.020
    Song Huaibo, Li Tong, Jiang Bo, Wu Qian, He Dongjian. Automatic detection of multi-target ruminate cow mouths based on Horn-Schunck optical flow algorithm[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(10): 163-171. DOI: 10.11975/j.issn.1002-6819.2018.10.020
    Citation: Song Huaibo, Li Tong, Jiang Bo, Wu Qian, He Dongjian. Automatic detection of multi-target ruminate cow mouths based on Horn-Schunck optical flow algorithm[J]. Transactions of the Chinese Society of Agricultural Engineering (Transactions of the CSAE), 2018, 34(10): 163-171. DOI: 10.11975/j.issn.1002-6819.2018.10.020

    基于Horn-Schunck光流法的多目标反刍奶牛嘴部自动监测

    Automatic detection of multi-target ruminate cow mouths based on Horn-Schunck optical flow algorithm

    • 摘要: 奶牛反刍行为的智能监测对于奶牛健康及提升现代养殖业的水平具有重要意义。奶牛嘴部区域的自动检测是奶牛反刍行为智能监测的关键,该文提出一种基于Horn-Schunck光流法的多目标奶牛嘴部区域自动检测方法。利用Horn-Schunck光流法模型求取奶牛反刍视频中各时间序列图像的光流场,将各帧序列图像中运动较大的光流数据进行叠加,获取奶牛反刍时的候选嘴部区域,最后运用奶牛嘴部区域检测模型实现反刍奶牛嘴部区域的检测。为了验证算法的有效性,利用不同环境下获取的12段视频进行验证,选取的12段视频的每段时长10 s,每段视频帧数在250~280帧之间,结果表明,对于多目标奶牛,12段视频中有8段视频可以成功检测到反刍奶牛的嘴部区域;根据所定义的真实充盈率指标与检测充盈率指标,分别统计了8段成功检测反刍奶牛嘴部区域的视频检测结果,试验表明,8段视频中最大真实充盈率为96.76%,最小真实充盈率为25.36%,总体平均真实充盈率为63.91%;最大检测充盈率为98.51%,最小检测充盈率为43.80%,总体平均检测充盈率为70.06%。研究结果表明,将Horn-Schunck光流法应用于多目标奶牛嘴部区域的自动检测是可行的,该研究可为奶牛反刍行为的智能监测提供参考。

       

      Abstract: Abstract: It is of great importance to realize the intelligent monitoring of dairy cow's rumination for improving the modern cultivation and supervision of cows' health. Cow's mouth area is the key to the intelligent monitoring of dairy cows' rumination. A multi-target cow rumination detection method based on Horn-Schunck optical flow method was proposed. The Horn-Schunck optical flow model was carried out to get optical flow field of the time series images for the ruminating video. In each frame of optical flow diagram, vector was used to represent the movement trend of the pixel block, the length of the vector represented the speed of the movement, and the direction of the vector represented the direction of the movement. The most intense part of the movement when cow is ruminating is related to the mouth area, and the region with the densest vectors in each frame of optical flow diagram is the cow's mouth area too. By superimposing each frame of optical flow diagram, the complete optical flow of cow mouth area could be obtained. The data of large optical flow in each frame were superimposed to a new optical flow graph, and the new optical flow graph was divided into binary image by using appropriate threshold segmentation. Disk type structure element was adopted in the mathematical morphological operation to the binary image. Because the most intense part of the movement when cow is ruminating is related to the mouth area, it could be determined that the largest area of the pixel block was the cow's mouth region, and the candidate cows' mouth regions were filtered out. A mathematical model was applied to detect the ruminant cows' mouth area. The main principle of this mathematical model was to determine the size and position of the test box. Setting test box as a square, the side length of the square is equal to the width of cow's mouth. To get the position of the test box, we need to get the coordinate of center point for the test box. Setting the x coordinate of the center point be equal to the rightmost x coordinate of the cow's mouth area minus 50% of cow's mouth width, the y coordinate is equal to the mean value of the y coordinate of each point for cow's mouth area minus 50% of cow's mouth width. In order to verify the effectiveness of the algorithm, 12 video data obtained from different environments including sunny day, cloudy day and strong windy day were verified. The length of each video is 10 seconds, and the number of video frames for each video is between 250 and 280 frames. The results showed that, for the multi-target cows, the proposed method could not detect the area of ruminant cow's mouth in strong wind environment in 2 videos, and could be used for the detection of ruminant cow's mouth in the remaining 10 videos. For 8 videos of the remaining 10 videos the region of ruminant cow's mouth could be detected successfully. According to the percentage of the actual mouth area by the detection box, the true filling rate was defined. According to the percentage of the optical flow algorithm's mouth area by the detection box, the detected filling rate was defined. The highest true filling rate of the 8 videos was 96.76%, the lowest true filling rate of the 8 videos was 25.36%, and the average true filling rate of the 8 videos for which the region of ruminant cow's mouth can be detected was 63.91%. The highest detected filling rate of the 8 videos was 98.51%, the lowest detected filling rate of the 8 videos was 43.80%, and the average detected filling rate of the 8 videos was 70.06%. The above results indicate that it is feasible to apply the Horn-Schunck optical flow method to detect the area of the multi-target cow's mouth automatically. This study provides the reference for intelligent monitoring of the ruminating behavior of cows.

       

    /

    返回文章
    返回