Camshift tracking method based on correlation probability graph for model pig

Xiangnan Zhang, Wenwen Gong, Qifeng He, Haolong Xiang, Dan Li, Yawei Wang, Yifei Chen, Yongtao Liu

Introduction

Automated livestock monitoring is a cornerstone of modern precision agriculture, yet tracking individual animals in a crowded, low-contrast environment remains a significant technical challenge. Researchers have recently introduced CamTracor-PG, an enhanced tracking algorithm designed to overcome the limitations of traditional color-based methods. By utilizing a "correlation probability graph," this system effectively suppresses background noise and maintains a stable lock on targets even when their visual signature nearly matches their surroundings.

The Challenge of Livestock Tracking

In a typical pig farm, computer vision systems face two primary hurdles. First, there is the issue of low contrast: pigs, often black or dark gray, frequently blend into the shadows, floor, and railings of their pens. Second, dynamic environments—characterized by shifting lighting and clutter like fodder or equipment—create significant noise for standard algorithms.

The standard Camshift (Continuously Adaptive Mean Shift) algorithm is a popular choice for real-time tracking due to its low computational cost. However, it relies heavily on color histograms. When a target's color is similar to the background, Camshift often "drifts," losing the target in the surrounding noise. CamTracor-PG seeks to rectify this drift while preserving the real-time efficiency of the original method.

The CamTracor-PG Innovation

The core innovation of this paper is the Correlation Probability Graph (PG). While standard Camshift creates an "inverse probability projection graph"—a grayscale map where pixel brightness indicates the likelihood of being the target—it treats each pixel in isolation, making it susceptible to noise.

CamTracor-PG introduces spatial context into this calculation. Instead of evaluating pixels individually, the algorithm performs a neighborhood check. For every pixel, it calculates a weighted summation based on the probabilities of its surrounding neighbors in a circular arrangement.

Fig. 1 Pixel distribution for spatial correlation calculation.

Because pigs are solid objects, their constituent pixels will naturally have high-probability neighbors. Conversely, background noise is typically scattered. By multiplying the center pixel's probability by those of its neighbors, the algorithm aggressively suppresses isolated noise while reinforcing the signal from the actual target. The system then uses zero-order and first-order moments to identify the target's centroid and adaptively adjust the tracking window's size and orientation.

Experimental Setup and Results

The study was validated using a massive real-world dataset from the Zhuozhou experimental demonstration base of the China Agricultural University. The researchers analyzed 425 GB of video data collected over 160 days, providing a rigorous test for long-term stability across varying lighting conditions.

When compared against basic Camshift and multi-feature fusion methods, CamTracor-PG showed superior performance:

  • Average Overlap Rate: The proposed method maintained an overlap rate of 85% to 91%. In contrast, basic Camshift and multi-feature fusion methods dropped as low as 28% and 20%, respectively, in complex frames.
  • Mostly Tracked (MT) Index: This metric tracks the proportion of the trajectory successfully followed. The CamTracor-PG maintained an 83% MT rate even after 4 hours of continuous tracking, whereas competing methods plummeted to 10% due to cumulative errors.

Conclusion

By treating probability as a neighborhood property rather than an isolated pixel value, CamTracor-PG offers a robust solution for livestock tracking without the computational overhead of complex multi-feature fusion. While future work may explore handling total occlusions or extreme lighting shifts that degrade Hue information, this method represents a significant leap in the stability of automated animal monitoring systems.

Summary updated

Abstract

The identification and tracking for model pigs, as a vital research content for studying the habits of model pigs, drawed more and more considerable attention. To fulfill people requirements for the effectiveness of the non-significant model pig tracking in breeding environment, a Camshift tracking approach based on correlation probability graph, i.e., CamTracor−PG, is proposed in this paper, in which the correlation probability graph is introduced to achieve target positioning and tracking. Technically, acquiring images through a vision sensor, according to the circular arrangement of pixels in the inverse probability projection graph, and multiplying the inverse projection probability value of a pixel by its surrounding pixels could obtain the weighted sum. Then, the target projection grayscale graph is established by utilizing the correlation probability value for positioning, identification, and tracking of model pigs. Finally, extensive experiments are conducted to validate reliability and efficiency of our approach.
BibTeX
@article{zhang2020camshift,
  author = {Xiangnan Zhang and Wenwen Gong and Qifeng He and Haolong Xiang and Dan Li and Yawei Wang and Yifei Chen and Yongtao Liu},
  title = {{Camshift tracking method based on correlation probability graph for model pig}},
  journal = {EURASIP J. Wirel. Commun. Netw.},
  year = {2020},
  doi = {10.1186/s13638-020-01699-0},
}
Figure