Abstract:The body size of farm animal is an important criterion for selection and appraising of variety resources, and body size is also employed to estimate animal body weight in many existing studies. In order to meet the requirement of measuring goat body size in a non-contact manner, a double view goat body images acquisition system was designed and the corresponding algorithm for goat body size calculating was developed. The double view images acquisition system was set up by using PLC controller, photoelectric sensors, limit switches, reducer motors, and industrial cameras. Goat's top view binary image was obtained by using background subtraction. The simple linear iterative clustering algorithm (SLIC) was introduced to construct the texture and color feature vectors of the superpixel of the side view goat body image. Each superpixel of a side view image was classified as foreground and background part by using a support vector machine (SVM) based classifier. The confidence and the region adjacent graph (RAG) of each superpixel were comprehensively used to binarize the side view goat body image. A set of methods for the body size feature points locating in the side and top view binary images of goat body was proposed. These feature points were further employed to calculate the goat body size parameters such as body height, body slant length, chest depth, chest width, and pipe diameter. Then, chest girth was fitted by using chest depth and chest width, circumference of cannon bone was fitted by using pipe diameter. The developed method was tested by using the double view images of Haimen goat collected in a breeding farm. The test results indicated that SLIC, SVM and RAG can segment the goat side view foreground with an accuracy of 94%. The intersection of union (IoU) of the side and top view foreground obtained by the algorithm and the manually labeled one were respectively 96.1% and 97.5%. The goat body size parameters calculated by using the developed algorithm were compared with those measured manually. The comparison results indicated that the average errors of the circumference of cannon bone, body height, chest depth, chest width, chest girth and body slant length were 5.5%,3.7%,2.6%, 5.2%,4.1% and 3.9%, respectively. Therefore, the image acquisition device developed can obtain the goat body double view images efficiently, and the proposed methods for goat image foreground segmentation and the feature points locating. Comprehensive utilization of the image acquisition device and the corresponding image processing algorithm developed provided a solution to the problem of measuring goat body size in an automatic manner.