CM3065 - Intelligent Signal Processing.

End of term assignement.

Exercise 1.2

Count the cars going to the city center.

Track the y and x co-ordinate as the car comes from right to left and add to counter if that is the case.
If cars move from left to right, ignore.

There are lines that are currently commented out that will give a visual indication of how the counting works.

Both videos are imported in line 10 and 11 in the code below.
You need to select the desired video in line 14 by making either:

Baseline code reference:

Install the required Python libraries

pip install pyttsx3
pip install pywin32
pip install numpy
pip install opencv-python

These libraries apply to both exercise 1.1 and 1.2

As we can see above, all the required packages are installed.
Lets start with the code.

First, import the required libraries.

Lets create a funtion to run and analyse the video clips, this way we can just call the function with the wanted video.

Lets call the function above with the first video.

Lets call the function above with the second video.