Computer Vision News - July 2019
Object Tracking in Python Using OpenCV In this article we will explain and implement the object tracking algorithms in OpenCV library. For many computer vision applications, we are given a video that contains an object, and we want to track the object's movement across different frames. The problem is usually solved using a bounding box that contains the object. The bounding box will be represented by four numbers: two for the location of the upper left angle of the rectangle and two for the lower right. Some of you may ask why we don't use YOLO or mask R-CNN on each frame and get the object's location? The answer is that tracking and detection are not the same tasks. Detection is a much harder task, which requires many more resources. Hence tracking is much faster than detection. Moreover, tracking usually preserves the location of the object; on the other hand, applying detection on each frame separately might not consider the relationship between the different frames. When choosing an object tracker, we need to consider its three major properties: Speed: in some application, we want our tracker to be able to process hundreds of frames per seconds (FPS). In other applications, the tracking is done offline so the speed is not very important. Accuracy: of course, we want our tracker to be accurate. However, in general, there is a trade-off between the accuracy and running time. A fast tracker might be inaccurate and vice versa. Occlusion robustness: when tracking a moving object, occlusion by other objects might be a common phenomenon. In some application, we want our tracker to cope with such occlusions and without moving to track the occluding object. Luckily enough, OpenCV library contains a tracking API with 8 tracking algorithms; Boosting, MIL tracker, kernelized correlation filters (KCF), discriminative correlation filter, median flow tracker, TLD tracker, MOSSE tracker and GOTRUN tracker. Each of those trackers has different ratio of speed to accuracy: in this article we will use the KCF tracker since it is fast, relatively accurate and good at failure detections. Tracking with Kernelized Correlation Filters (KCF) In tracking tasks, our goal is to find the object in the current frame, given its location, shape and structure in the previous frames. The main idea of the KCF 38 Tool Focus on by Amnon Geifman Computer Vision News “… tracking and detection are not the same tasks! ”
Made with FlippingBook
RkJQdWJsaXNoZXIy NTc3NzU=