Object tracking in video has undergone a change with the Internet of Things (IoT) being at the forefront of rapidly developing technology. Let’s take a quick look at what object tracking is all about.

Object tracking in video

Once an object is scanned and detected in video, it can be ‘tracked’ or ‘followed’ to monitor its movement or know where it is going. This is done by taking several snapshots of the video and pausing the images at various times. It is then possible to track the object by ascertaining just how often the object  has moved in different frames of the video. The IoT aids in carrying out this process seamlessly.

Process summary

Let’s discuss the various uses of object tracking in video. When you have video input, manual effort taken to track an object is reduced. Not only is this a cost-saving device, but also reduces human dependency  significantly. It is interesting to note that prior to the introduction of this technology, methods such as using special hardware were deployed to track objects. In the case of vehicular traffic, manual efforts were put in, to track and count the same.

To cite an example, when object tracking is used to monitor objects on a conveyor belt, automatic labelling  can be used to create a better classifier with reduced manual effort. With the code pattern that we will walk through in the latter half of this document, creating and using a classifier that can identify objects in motion will be carried out. Using this information, these objects can then be tracked, and a count can be taken, as they appear in a pre-defined range or region.

Process description

Object  tracking  in video has  use cases across  several industries and  areas of application. Prominent among these are, to track vehicular and/ or human traffic, as well as products on a conveyor belt in a standard manufacturing setup. Using video cameras, business owners can gain access to some much-needed information that can be vital to their operations.

Continuing  with the same  example, let us  learn how to create  a video car counter using  the PowerAI Vision Video Data Platform, OpenCV, and a Jupyter Notebook. Once the model has been created, it can be deployed to detect cars, for instance, on a sample of the video frames at a regular, pre-defined interval. OpenCV can then be used to track the cars from frame to frame.

On completion of the code pattern, one can expect to gain an understanding of how to:

  1. Use automatic labelling to create an object detection classifier from a video
  2. Process frames of a video using a Jupyter Notebook, OpenCV, and PowerAI Vision
  3. Detect objects in video frames with PowerAI Vision
  4. Track objects from frame to frame with OpenCV
  5. Count objects in motion as they enter a region of interest
  6. Annotate a video with bounding boxes, labels, and statistics

Process flow

Let us understand the process flow to be followed in order to create the code pattern for object tracking in video with OpenCV and Deep Learning:

Step-by-step process:

  1. Upload a video using the PowerAI Vision web UI
  2. Use automatic labelling and train a model
  3. Deploy the model to create a PowerAI Vision inference API
  4. Use a Jupyter Notebook to detect, track, and count cars in a video

Instructions to create the code

While the above process flow gives a concise overview of the process, the detailed guide for this pattern can be found in the README document.

The steps detailed therein will explain how to:

  1. Create a data set in Video Data Platform
  2. Train and deploy the model
  3. Automatically label objects
  4. Run the notebook
  5. Create the annotated video

Alternate applications for object tracking

In most cases as on date, object tracking is being utilized to monitor human and vehicular movement. People counting and face detection are two such applications. For instance, this technology is used on social media platforms to identify an individual when a photograph is uploaded. Analyzing crowd statistics for example during film and music festivals is another use of object tracking. In the manufacturing process, this technology can be used to detect a particular type of product, separate from the rest.

Conclusion

Given the already existing versatility of object tracking in video, it is predicted that this technology will also be used extensively in future as well. One of the areas that has been identified includes using object tracking in quadcopters to identify anomalies in war equipment such as explosives.

https://ibm.co/2MwzI9M