Motion Detection using Python and OpenCV

Implement a vehicle counter and a social distancing detector using background subtraction algorithms! All step by step
Motion Detection using Python and OpenCV
File Size :
2.73 GB
Total length :
5h 9m



Jones Granatyr


Last update




Motion Detection using Python and OpenCV

What you’ll learn

Understand the basic intuition about background subtraction applied to motion detection
Implement MOG, GMG, KNN and CNT algorithms using OpenCV, as well as compare their quality and performance
Improve the quality of the results using pre-processing techniques such as morphological operations and blurring
Implement a motion detector for monitoring environments
Implement a social distancing detector
Implement a car and truck counter using highway videos

Motion Detection using Python and OpenCV


Programming logic
Basic Python programming


Motion detection is a sub-area of Computer Vision that aims to identify motion in videos or in real time. This type of application can be very useful, especially for security systems, in which it is necessary to detect suspicious movements such as a thief trying to enter the house. There are several other applications, such as: traffic analysis on highways, people detection/counting, animal tracking, cyclist counting, among others. A traffic control system can use these techniques to identify the number of cars and trucks that pass through the highway daily and at certain times, so then it is possible to carry out a road maintenance plan.In this course you will learn in practice how to use background subtraction algorithms to detect movements in videos, all step by step and using Python programming language! Check out the main topics you are going to learn, as well as the hands-on projects:Basic theoretical intuition about the following background subtraction algorithms: Temporal Median Filter, MOG (Mixture of Gaussians), GMG (Godbehere, Matsukawa and Goldbert), KNN (K Nearest Neighbors) and CNT (Count)Comparison of quality and performance of each algorithmPractical project 1: motion detector to monitor environmentsPractical project 2: social distancing detector to identify possible crowds of peoplePractical project 3: car and truck counter on highwaysAt the end of the course, you will be able to create your own motion detection projects!


Section 1: Introduction

Lecture 1 Course content

Lecture 2 Course materials

Section 2: Background subtraction

Lecture 3 Background subtraction – intuition

Lecture 4 Temporal median filter – intuition

Lecture 5 Installing Anaconda and PyCharm

Lecture 6 Temporal median filter – implementation 1

Lecture 7 Temporal median filter – implementation 2

Lecture 8 Temporal median filter – implementation 3

Lecture 9 Other algorithms: MOG, GMC, KNN, and CNT

Lecture 10 Additional reading

Lecture 11 Image preprocessing techniques

Lecture 12 MOG, GMC, KNN and CNT – implementation 1

Lecture 13 MOG, GMC, KNN and CNT – implementation 2

Lecture 14 MOG, GMC, KNN and CNT – implementation 3

Lecture 15 MOG, GMC, KNN and CNT – implementation 4

Lecture 16 MOG, GMC, KNN and CNT – implementation 5

Lecture 17 Quality comparison 1

Lecture 18 Quality comparison 2

Lecture 19 Performance comparison

Section 3: Practical projects

Lecture 20 Motion detection 1

Lecture 21 Edge detection – intuition

Lecture 22 Motion detection 2

Lecture 23 Social distancing

Lecture 24 Vehicle counter 1

Lecture 25 Vehicle counter 2

Lecture 26 Vehicle counter 3

Lecture 27 Vehicle counter 4

Lecture 28 Vehicle counter 5

Section 4: Final remarks

Lecture 29 Final remarks

People interested in implementing motion detectors or object counters,Undergraduate and postgraduate students studying Computer Graphics, Digital Image Processing or Artificial Intelligence,Data Scientists who want to increase their knowledge in Computer Vision

Course Information:

Udemy | English | 5h 9m | 2.73 GB
Created by: Jones Granatyr

You Can See More Courses in the Developer >> Greetings from

New Courses

Scroll to Top