Let’s now take a slightly detailed look at the problem we will solve in this session.
You can download the video for the problem statement here.
Before any road construction, the government needs to determine the width and strength of the road, along with numerous other factors. These factors are determined by counting and categorising the vehicles that would run on the road once it’s built. Earlier, manual surveys were conducted by counting the number of vehicles passing through the lane and categorising vehicles as a car, a truck, etc. Anand Muglikar has automated this process and it is used by Pune Municipal Corporation. Let’s see the approach that he used.
Vehicle detection:
- The first step is to break a video into individual frames.
- Then, make an imaginary (virtual) line across the lane.
- To keep the track of the vehicles, increase the vehicle count by one whenever a vehicle crosses the imaginary line.
Vehicle classification:
- Crop the vehicle that just passed the imaginary line.
- Classify the cropped vehicle using a CNN classifier.
That’s it! That’s the gist of the entire process. However, the process becomes a little complex when you want to implement this algorithm in code.
In this session, our aim to give you hands-on- experience in working with video files. After you go through this session, you will be able to take any video file and perform a similar sort of analysis on it. You can try out your skills learnt in this session in other domains that deal with video analysis.
Note: People who have no experience in analysing videos might face some difficulty due to the new terminology used in vehicle detection section. We’ve used a top-down approach where we use terminologies and techniques of computer vision as and when needed in this problem. Feel free to seek help from online sources to understand the techniques where you feel you’re facing difficulty to understand.
Coming Up
You will start looking at the code on the next page. The first few steps involve initialisation of variables and defining some classes.
Report an error