Added a perimeter tracking function to trace the perimeter of an object.