Monitoring pig movement at the slaughterhouse using optical flow and modified angular histograms

Ruta Gronskyte, Line Katrine Harder Clemmensen, Marchen Sonja Hviid, Murat Kulahci

Research output: Contribution to journalJournal articleResearchpeer-review


We analyse the movement of pig herds through video recordings at a slaughterhouse by using statistical analysis of optical flow (OF) patterns. Unlike the previous attempts to analyse pig movement, no markers, trackers nor identification of individual pigs are needed. Our method handles the analysis of unconstrained areas where pigs are constantly entering and leaving. The goal is to improve animal welfare by real-time prediction of abnormal behaviour through proper interventions. The aim of this study is to identify any stationary pig, which can be an indicator of an injury or an obstacle. In this study, we use the OF vectors to describe points of movement on all pigs and thereby analyse the herd movement. Subsequently, the OF vectors are used to identify abnormal movements of individual pigs. The OF vectors, obtained from the pigs, point in multiple directions rather than in one movement direction. To accommodate the multiple directions of the OF vectors, we propose to quantify OF using a summation of the vectors into bins according to their angles, which we call modified angular histograms. Sequential feature selection is used to select angle ranges, which identify pigs that are moving abnormally in the herd. The vector lengths from the selected angle ranges are compared to the corresponding median, 25th and 75th percentiles from a training set, which contains only normally moving pigs. We show that the method is capable of locating stationary pigs in the recordings regardless of the number of pigs in the frame.
Original languageEnglish
JournalBiosystems Engineering
Issue numberJanuary
Pages (from-to)19-30
Publication statusPublished - 2016


  • Optical flow
  • Support Vector Machines
  • Modified angular histograms
  • Abnormal movement detection


Dive into the research topics of 'Monitoring pig movement at the slaughterhouse using optical flow and modified angular histograms'. Together they form a unique fingerprint.

Cite this