An Algorithm of Pig Segmentation from Top-View Infrared Video Sequences

Conference paper
Part of the Advances in Intelligent Systems and Computing book series (AISC, volume 1196)


This paper considers the problem of pig automatic segmentation from infrared top view images of a pen. Particularly, an algorithm for accurate delineation of pig’s contour is presented. The method consists of two main steps. In the first step, a rough contour is determined using standard image processing methods. Next, the initial contour is gradually deformed so that it reflects the actual contour of the pig as much as possible. This effect is obtained by attracting initial contour points to the nearest local gradient peaks. In the last step, the contour is refined and smoothed by removing loops. This step incorporates analysis of the angles between contour segments passing through the consecutive contour points. Results of the proposed approach for sample infrared images of pigs in a pen are presented and discussed. They reveal that the method performs reasonably well with the average DICE score exceeding the level of 0.97 and the average Jaccard index above 0.95.


Computer vision Agriculture Pig segmentation Image processing 


  1. 1.
    Ju, M., Choi, Y., Seo, J., Sa, J., Lee, S., Chung, Y., Park, D.: A kinect-based segmentation of touching-pigs for real-time monitoring. Sensors (Basel) 18(6), 891–921 (2018). Scholar
  2. 2.
    Kongsro, J.: Estimation of pig weight using a Microsoft Kinect prototype imaging system. Comput. Electron. Agric. 109, 32–35 (2014). Scholar
  3. 3.
    Li, C., Lee, C.: Minimum cross entropy thresholding. Pattern Recogn. 30, 617–625 (1993). Scholar
  4. 4.
    Nilsson, M., Ardo, H., Astrom, K., Herlin, A., Bergsten, C., Guzhva, O.: Learning based image segmentation of pigs in a pen. In: 22nd International Conference on Pattern Recognition (ICPR) (2014)Google Scholar
  5. 5.
    Pezzuolo, A., Milani, V., Zhu, D., Hao, G., Guercini, S., Marinello, F.: On-barn pig weight estimation based on body measurements by structure-from-motion (SfM). Sensors 18, (2018).
  6. 6.
    Satoshi, S., Keiichi, A.B.: Topological structural analysis of digitized binary images by border following. Comput. Vis. Graph. Image Process. 30, 32–46 (1985). Scholar
  7. 7.
    Zhang, L., Gray, H., Ye, X., Collins, L., Allinson, N.: Automatic individual pig detection and tracking in surveillance videos (2018)Google Scholar

Copyright information

© Springer Nature Switzerland AG 2020

Authors and Affiliations

  1. 1.Institute of Applied Computer ScienceLodz University of TechnologyLodzPoland

Personalised recommendations