Abstract:In order to improve the detection accuracy of cow mastitis, an automatic eye and breast location method was proposed by using thermal infrared imaging technology to measure the temperature of key parts of cow. The gray scale histogram of the thermal infrared image of dairy cows was firstly analyzed, and then the HSV color features and skeleton features in the threshold segmentation images were extracted. Then, the eye position of dairy cows was automatically detected based on the HSV (Hue, Saturation, Value), and the skeleton feature vector was calculated, which was used to classify and automatically detect the breast position by the support vector machine. In order to verify the effectiveness of the positioning algorithm, totally 40 randomly selected naturally walking cows were verified. The test results showed that the positioning algorithm proposed could effectively locate the eyes and breasts of cows, and the accuracy of video frame recognition within the positioning error of 20 pixels was 68.67%. The cow eyes obtained according to the positioning algorithm was carried out on the temperature difference value of breast milk cow mastitis test, rating by temperature threshold and degree of dairy cow mastitis morbidity and somatic cell count method, comparing the test results it was showed that the rating 1 detection accuracy was 33.3%, the rating 2 detection accuracy was 87.5%. The results of this study can accurately obtain the position and temperature of the eyes and breast under the natural walking condition.