OpenCV Python Tutorial For Beginners 24 – Motion Detection and Tracking Using Opencv Contours

///OpenCV Python Tutorial For Beginners 24 – Motion Detection and Tracking Using Opencv Contours

OpenCV Python Tutorial For Beginners 24 – Motion Detection and Tracking Using Opencv Contours

FavoriteLoadingAdd to favorites

In this video on OpenCV Python Tutorial For Beginners, I am going to show How to Find Motion Detection and Tracking Using Opencv Contours.
We will see what contours are. we will Learn to find contours, draw contours, we will see these functions : cv2.findContours(), cv2.drawContours(). In this project we are detecting and tracking motion using live sample video.
The function retrieves contours from the binary image. The contours are a useful tool for shape analysis and object detection and recognition.

Gist of code I used in this video (Motion Tracking and Detection Tutorial ) –

OpenCV is an image processing library created by Intel and later supported by Willow Garage and now maintained by Itseez. opencv is available on Mac, Windows, Linux. Works in C, C++, and Python.
it is Open Source and free. opencv is easy to use and install.

Starting with an overview of what the course will be covering, we move on to discussing morphological operations and practically learn how they work on images. We will then learn contrast enhancement using equalization and contrast limiting. Finally we will learn 3 methods to subtract the background from the video and implement them using OpenCV.

At the end of this course, you will have a firm grasp of Computer Vision techniques using OpenCV libraries. This course will be your gateway to the world of data science.

Feel the real power of Python and programming! The course offers you a unique approach of learning how to code by solving real world problems.

#ProgrammingKnowledge #ComputerVision #OpenCV
★★★Top Online Courses From ProgrammingKnowledge ★★★
Python Programming Course ➡️ ⚫️
Java Programming Course ➡️ ⚫️
Bash Shell Scripting Course ➡️ ⚫️
Linux Command Line Tutorials ➡️ ⚫️
C Programming Course ➡️ ⚫️
C++ Programming Course ➡️ ⚫️
PHP Programming Course ➡️ ⚫️
Android Development Course ➡️ ⚫️
C# Programming Course ➡️ ⚫️
JavaFx Programming Course ➡️ ⚫️
NodeJs Programming Course ➡️ ⚫️
Jenkins Course For Developers and DevOps ➡️ ⚫️
Scala Programming Tutorial Course ➡️ ⚫️
Bootstrap Responsive Web Design Tutorial ➡️ ⚫️
MongoDB Tutorial Course ➡️ ⚫️
QT C++ GUI Tutorial For Beginners ➡️

★★★ Online Courses to learn ★★★
Get 2 FREE Months of Unlimited Classes from skillshare –
Data Science – |
Machine Learning – |
Artificial Intelligence – |
MERN Stack E-Degree Program – |
DevOps E-degree – |
Data Analytics with R – |
AWS Certification Training – |
Projects in Java – |
Machine Learning With TensorFlow – |
Angular 8 – Complete Essential Guide –
Kotlin Android Development Masterclass –
Learn iOS Programming Building Advance Projects –

★★★ Follow ★★★
My Website –

DISCLAIMER: This video and description contains affiliate links, which means that if you click on one of the product links, I’ll receive a small commission. This help support the channel and allows us to continue to make videos like this. Thank you for the support!

source

By |2019-12-27T00:47:24+00:00December 27th, 2019|Python Video Tutorials|33 Comments

33 Comments

  1. Shiwam Jaiswal December 27, 2019 at 12:47 am - Reply

    How do we decide the threshold value? Isn't it better to use OTSU's Binarization to calculate the threshold value

  2. Efekan EFE December 27, 2019 at 12:47 am - Reply

    You gave me hope dude.You are the man!Thank you so much for helping us about the topics that we can't easily learn from anybody.

  3. emna guermazi December 27, 2019 at 12:47 am - Reply

    Hey,can u tell me ur ide?

  4. sulman yousaf December 27, 2019 at 12:47 am - Reply

    this error is occurring what i should do now ?
    diff = cv2.absdiff(frame1, frame2)

    TypeError: Expected Ptr<cv::UMat> for argument '%s'

  5. Lyle Chen December 27, 2019 at 12:47 am - Reply

    13:25 How can you filter the countours just by the size of their boundings, rather than adjusting dilate threshold!

  6. rakshitha rakshi December 27, 2019 at 12:47 am - Reply

    can u tell me which algorithm ur using

  7. Daniel Schöler December 27, 2019 at 12:47 am - Reply

    8:14 "for the mode we are using RETR_TREE because it is most commonly used" Well if you knew what you did u'd use RETR_EXTERNAL, because since you don't extract your hierarchy, you do not really need to extract all these informations … Just saying. Man you have just copied this somewhere. This is the poorest 'tutorial' ever

  8. Daniel Schöler December 27, 2019 at 12:47 am - Reply

    Every word you say is just what is happening on the screen. If you comment videos like this, then please explain what this cv2.absdiff() or the cv2.threshold() do. Don't just say what you do. Explain why you do it, pls.

  9. VINIT MUNDRA December 27, 2019 at 12:47 am - Reply

    Hi there, can u pls explain how will there be any difference (I mean how will there be a absolute difference value) between the two frames i.e frame1 and frame2 , as they both are taking input from the same video??
    Pls correct me if am wrong somewhere!!

  10. Nadhirah Hairi December 27, 2019 at 12:47 am - Reply

    Can i know what is the difference between motion detection and object detection? Does it have differences?

  11. Kpsr December 27, 2019 at 12:47 am - Reply

    i translated it all to C++ and it is compiling but unfortunately there is no contours drew
    edit: after debugging i realized that contours are shown only at first frame
    edit2: okay so after my investigation i found out that in C++ there might be a problem with "=" operator for Mat class and frame1=frame2 isnt working propely. i had to replace it for frame1=frame2.clone()

  12. Mouad Lazrak December 27, 2019 at 12:47 am - Reply

    where do i can get such a video ?

  13. Fadhel Al Suwaidi December 27, 2019 at 12:47 am - Reply

    Hi
    Its wonderful video, can u make the camera record when the motion start, I mean record every motion, when camera detect someone moving start to record the video, it will be greate if u teach is how to do it.

  14. kraskagm December 27, 2019 at 12:47 am - Reply

    When it is taking difference between two frames, shouldn't it be 0 because the same video input is used(captured)?

  15. Mustafa YETİŞ December 27, 2019 at 12:47 am - Reply

    if you watch previous tutorials you will understand what is happening behind syntax

    briefly,

    first step, movement is difference between two frames

    second, difference has noises because of details and light on video so gaussian blurring is eliminating the noises,

    third, obtaining threshold from clean difference

    fourth, dilating for eliminating district small weak threshold lines which corrupt healthy threshold detection

    fifth, finding contours from clean threshold

    sixth, eliminating small contours which can not be a human by filtering contour area

    seventh, drawing rectangles for each detected contour on the frame, rectangle dimensions obtained from cv2.boundingRect(contour)

    that is it!

  16. Mustafa YETİŞ December 27, 2019 at 12:47 am - Reply

    By evaluating the aspect ratio of each rectangle , we can determine whether it is a person or not.
    if Height/Width >1 then it may be a person
    elif Height/Width <1 then it may be a short person or sitting person or animal etc.
    else it may be lying object (for example horizontal safeguard lines in this tutorials)
    we can eliminate objects which is different from walking persons to an extent.

  17. Neal M December 27, 2019 at 12:47 am - Reply

    Got it to work, but unable to save the output. Can you please share where I would insert this within this particular source code?

  18. Isaiah B December 27, 2019 at 12:47 am - Reply

    How would i make this only track one person?

  19. Gürkan UÇAR December 27, 2019 at 12:47 am - Reply

    Hi, thanks for project but how can i change sensitivity?

  20. Dhruv Patel December 27, 2019 at 12:47 am - Reply

    Pls upload tutorial on creating own haar cascade classifier

  21. Ashish Sv December 27, 2019 at 12:47 am - Reply

    What's the use of taking difference between 2 frames??why it is needed..??
    Please reply..

  22. Daniel Segel December 27, 2019 at 12:47 am - Reply

    You don't explain what any of the options to cv2 functions actually do. The only thing I learned is the syntax.

  23. U Cus December 27, 2019 at 12:47 am - Reply

    Thank you for this video.
    Question: Why are you showing frame1 and not frame2? Because frame2 should be closer to realtime picture

  24. Ab dremo December 27, 2019 at 12:47 am - Reply

    Nice nice

  25. Decoding Computers December 27, 2019 at 12:47 am - Reply

    Good tutorial

  26. arbaz khan December 27, 2019 at 12:47 am - Reply

    sir im having this error please help
    contours, _ = cv2.findContours(dilated, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)

    ValueError: too many values to unpack (expected 2)

  27. kunal gurtatta December 27, 2019 at 12:47 am - Reply

    can this comment get a heart ?👀

  28. Benjamin Salazar December 27, 2019 at 12:47 am - Reply

    This is very inspiring content. Thank you for sharing.

  29. Filip Hessle December 27, 2019 at 12:47 am - Reply

    First

  30. chirag kumar December 27, 2019 at 12:47 am - Reply

    Thanks for this great tutuorial.

  31. Nico Estay December 27, 2019 at 12:47 am - Reply

    Hi, great video!
    i have a question, how can i know how much people are in the input video?

  32. Abhijeet Mandal December 27, 2019 at 12:47 am - Reply

    Sir please suggest me
    I'm completed graduation in BCA
    So what I will do after complete python core and advance
    Django or any other

  33. Abhijeet Mandal December 27, 2019 at 12:47 am - Reply

    Super

Leave A Comment

*