Pork quality is an important indicator for the evaluation of national food health level.At present,paying more attention to the welfare and health of pigs is an effective way to improve the quality of pork,which is the also the focus in pig production.To evaluate the welfare and health of pigs,monitoring pigs’ locomotion information is considered the useful method.Grab the information of the pig’s behavior also can help improve the level of production management.Locomotion information of pigs is proved to have close association with their habits and their normal and abnormal behaviors.It can predict the outbreak of most diseases in pig group.Visual observation is the current monitoring method in pig farms.It is obviously labor intensive,objective and difficult to achieve 24í7 monitoring.Thus the automated movement monitoring and intelligent analysis system of pigs has important scientific significance and good prospects in pig industry.This paper mainly addresses the construction of WSPN(Wireless Sensor Position Network),the method to monitoring the pig’s movement information,including position,trajectory,speeds,mileages,energy consumption)and its behavioral recognition based on machine vision technology.WSPN based on the Contiki OS(Operation System)collected the RSSI value(wireless signal propagation loss),and calculate the pig’s positions.Images were captured from the real-time video filmed with a USB camera mounted in the ceiling of the pig barn.The pig body area was segmented from the top viewed images using image processing technology.The positions of the pig defined by the centroid of the pig body area and the time sequence were combined to from the parameters of the movement information,which were speeds,mileages and energy consumption of each daylight hours.These parameters were utilized to analyze the pig’s behaviors,including lying,eating,drinking,dunging and walking.The recognition results agree well with the manual annotation.In terms of the procedures described above,the results of this study are summarized as follows:1)WSPN was comprised of the ear tag module,the fixed anchor nodes and routing gateway operating with the Contiki OS platform.The ear tag module uses UDPcommunication protocol to communicate with other wireless nodes.RSSI interface of the host computer was written by the Windows C#,with real-time data display and SQL database storage.2)It achieved the routing and transmission between the ear tag and the gateway,the acquisition of the RSSI value of the ear tag and the communication of the local area network.Designing of low power consumption in ear tag will be increased to about 30 days in using.Pig farm experiment on ear tag positioning system was implemented.The pig body test showed that when the pig was stationary,the receiver received no loss in 2.5m,and the packet loss rate increased and the signal quality index decreased gradually when the distance increased.When the distance is about 6m,the packet loss rate can reach 69.35%,and the LQI connection quality index is about 87.3225.Due to the complex environment of the pig farm,the wireless communication had a serious multipath effect,which leaded to the increase of packet loss rate and the instability of the RSSI numerical jump.3)A camera platform was constructed to achieve the data transmission through USB port.An image acquisition software installed on the host computer based on MATLAB GUI development platform was designed.Pig farms were collected five days of image data,the sampling rate of 1 frame /s,a total of theoretical acquisition of 217760 frames,the actual sampling of 213379 frames,lost frame rate of 2.012%.4)A segmentation algorithm based on color threshold division was designed,which realized the segmentation of pig body in binary level.The accuracy of segmentation was 99.96%,100%,99.54%,99.84%,and 99.76%,respectively.The average daily segmentation accuracy was 99.5%.Part of the segmentation errors included the main interference,entered pigsty by breeder and ground reflective of pigsty.5)The movement parameters were obtained by combining the time series and thepig body centroids,which was based on the binary images.The average speeds of the pig in five days were 0.0166m/s,0.0145m/s,0.0218m/s,0.0219m/s,0.019m/s;The movement distances were 697.2165 m,615.3795 m,923.2795 m,932.4832 m,778.8665 m,the average daily movement distance was 789.4450m;Consumption of energy were 813.2688 KJ,626.5674,1438.11 KJ,1157.486 KJ,843.3268 KJ,the average daily consumption was 975.75 KJ.6)A behavior recognition algorithm was designed to recognize five behaviors of the pig by combining the positions and speeds of the pig.According to the location of the trough and the drinker and the living habits of the pig,the pen was divided into the eating area,the drinking water area,the dunging area,the lying area.On the basis of regional division,according to the speed threshold to determine whether to eat,drink,discharge,lying and walking.Compared with the manual statistics,the results show that Coincidence degree of the recognition result of the algorithm and artificial statistics in the time and place of the occurrence is higher.The experiment in pig pen shows that WSPN is highly influenced by the environment and the pig movement.The method based on the machine vision achieved the tracking task accurately,and obtained the movement information effectively.It can meet the long term requirement and the numerous data acquisition.Therefore,the obtaining of pig movement information based on machine vision technology can provide a new idea for the precise,automated breeding. |