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:
- Use automatic labelling to create an object detection classifier from a video
- Process frames of a video using a Jupyter Notebook, OpenCV, and PowerAI Vision
- Detect objects in video frames with PowerAI Vision
- Track objects from frame to frame with OpenCV
- Count objects in motion as they enter a region of interest
- 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:
- Upload a video using the PowerAI Vision web UI
- Use automatic labelling and train a model
- Deploy the model to create a PowerAI Vision inference API
- 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:
- Create a data set in Video Data Platform
- Train and deploy the model
- Automatically label objects
- Run the notebook
- 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.