Distributed perimeter patrolling and tracking for camera networks