Abstract:A real-time video capturing system for dairy was designed, and a detection method of breathing rate and abnormity in cows was studied based on the system to acquire the information in breathing. The optical flow method was used to calculate the velocity for each pixel. Breathing points were found out by looping Otsu operation according to the magnitude of velocity. The period was calculated from the curve of direction of velocity to get the breathing rate, and breathing abnormity was detected according the duration of each breath. 72 cows were detected for total 360 minutes to test the methods. The results demonstrated that the accuracy of calculated breathing rate and the recognition ratio of breathing abnormity were 95.68% and 89.06%, respectively, and the error detection of breathing abnormity was 2.53 times per-minute.