| With the increase of the pork market demand and the improvement of the technology level,the scale of pig farming is expanding and the degree of intensification is becoming higher and higher.It is one of the hot spots in the present research to use the machine vision monitoring instead of manual monitoring to reduce the input cost,improve the level of automation and increase the economic benefit.In this paper,obtaining the video of pig motion based on the video monitoring system of pig farm,the method of detection and tracking of the pig object is compared and researched by the machine vision technology.In combination with the living habits of pig,the abnormal evaluation system based on the pig movement track is established.The main research works of this paper are as follows:(1)This paper expounds the important significance of the intelligent monitoring of pig objects,and summarizes the current research status of object detection,tracking of livestock behavior and the analysis of abnormal pigs.(2)In order to accurately detect the pig object in the video images,In order to accurately detect the pig target in the video image,from the perspective of moving object detection,the theories of background difference method,frame difference method,the optical flow method and the Gaussian mixture modelmethod are expounded,and the pig object detection is analyzed experimentally in the aspects of advantages,disadvantages and applicability.From the perspective of static object detection,this paper repeatedly experiments to compare the results of color detection,Mean Shift method and GrabCut segmentation method.According to the defects of GrabCut segmentation method that the iteration is not accurate,and each iteration time is long,this paper proposes a method of combining color feature and Grab Cut segmentation that use the high speed of color detection and the accuracy of the detection of pig object in the simple background,and then use color detection on GrabCut segmentation results to improve the accuracy of pig object detection.(3)In order to accurately track the pig,firstly,several algorithms such as feature matching and particle filter are elaborated and tested,but the results are not satisfactory.After determining the Vibe algorithm as the tracking algorithm,three groups of experiments are used to analyze the defects of the tracking algorithm.Aiming at some defects,three improved strategies are proposed: a)In the initial stage,a small time re-sampling factor is used to speed up the melt of ghost.After a period of time,increase the value of time re-sampling factor to slow down the melting speed of static pig object;b)The pig resting area is set to ROI area,and the object detection method is used to detect the long time stationary pig object in the rest area;c)Using threshold method to determine effective tracking area.When the area of the connected region is in the effective threshold interval,the connected region is an effective tracking region,and pigsin the state of motion or transient quiescence.The connected region is tracked,and the center point of the minimum bounding rectangle is connected with the nearest neighbor rule to draw the movement track;When the number of effective tracking regions is reduced,it shows that some pigs are static in a long time.Finding the corresponding point(,)tp x y in the previous frame,generating ROI region from the center point(,)tp x y,using object detection method to find stationary pig object.When the pig moves again,the center of the new minimum bounding rectangle is connected to(,)tp x y to ensure the continuity of the movement track.The experimental results show that the improved tracking strategies can effectively achieve the pig object tracking in complex pig farm environment,and can get the pigs’ movement track accurately.(4)Based on the movement track of the pig object and the behavioral anchored rating scale,four key events of pig eating,drinking water,excretion and rest are extracted after analyzing the characteristics of pig’s living habits.The health evaluation table is established respectively.Considering four kinds of pig behavior,the degree of pig abnormal behavior can be judged. |