Tracking Objects | OpenCV Python Tutorials for Beginners 2020

  Рет қаралды 127,430

Murtaza's Workshop - Robotics and AI

Murtaza's Workshop - Robotics and AI

Күн бұрын

In this video, we are going to learn object tracking. We will use our mouse to select an object and track it using different methods that OpenCV has to offer. This is a fairly simple tutorial so it should be easy to follow.
Code (in Intermediate Concepts section):
coming soon
Note: If you are getting an error of tracker not found after installing the latest contrib pacakge, then use the version in the video which is 4.2.0.32.
Tracker Description Blog:
ehsangazar.com/object-trackin...
🚀🚀 My Urdu/Hindi AI KZbin Channel 🚀🚀
/ @murtazahassan01
Premium Courses:
✔️ Computer Vision Game Development Course:
bit.ly/3ttLZ2s
✔️ Computer Vision with Arduino Course:
bit.ly/3wzLB4m
✔️ Advanced Drone Programming Course:
bit.ly/3qs3v5g
✔️ Learn to Build Computer Vision Mobile Apps:
bit.ly/3uioY1J
✔️ Jetson Nano Premium Course:
bit.ly/3L8uIlF
⚙️⚙️⚙️--My Gear - ⚙️⚙️⚙️
👉 Complete Gear 💈: www.computervision.zone/tech-...
👉 My PC Specs 🖥️: www.computervision.zone/tech-...
👉 My Video Shooting Gear📽️ : www.computervision.zone/tech-...
👉 My Laptops 💻: www.computervision.zone/tech-...
👉 Educational Products🧑‍🎓: www.computervision.zone/tech-...
👉 KZbin Starter Kit 🔴: www.computervision.zone/tech-...
Follow Me:
TikTok: bit.ly/3Vo76OQ
Facebook Group: bit.ly/3irDcb7
Discord: bit.ly/3JvyxAM
Facebook Page: bit.ly/3IvpU7W
Instagram : bit.ly/3NdGME3
Website: bit.ly/3ICFTS0
Github: bit.ly/3woU6PS
#ComputerVision
#OpenCV
#CVZone

Пікірлер: 283
@murtazasworkshop
@murtazasworkshop 2 жыл бұрын
If you are using the latest version of opencv contrib and you get the error AttributeError: module 'cv2' has no attribute 'TrackerMOSSE_create' use cv2.legacy.TrackerMOSSE_create() instead of cv2.TrackerMOSSE_create()
@proskurlandsky
@proskurlandsky Жыл бұрын
but now it has no module legacy
@mangostain
@mangostain Жыл бұрын
@@proskurlandsky please uninstall opencv-python and the install the opencv-contrib-python package pip uninstall opencv-python pip install opencv-contrib-python it worked for me
@ettiennegerwel6616
@ettiennegerwel6616 2 жыл бұрын
Great tutorial! Very simple and clear. Awesome man.
@aniketroy5865
@aniketroy5865 2 жыл бұрын
You are really a savior for beginners like us, you provide us a headstart otherwise we had to bang our heads in long documents to get things done
@TheNazbul
@TheNazbul 8 ай бұрын
in the whole youtube nobody is better than you when it comes to explanation. no one can explain each and every line you do sir. this indicates how much you like coding. thank you sir i learnt a lot from you.
@kyriosabbes3737
@kyriosabbes3737 4 жыл бұрын
Good work ☺️, we are waiting about YOLOv3 🔥🔥🔥
@ChickenJY
@ChickenJY 4 жыл бұрын
Dear Murtaza, a very big thanks for your help! Your video is sharp and crystal clear.
@murtazasworkshop
@murtazasworkshop 4 жыл бұрын
Glad it helped
@magelauditore333
@magelauditore333 3 жыл бұрын
Great and very detailed explanation. Thanks a lot
@antoniodome9306
@antoniodome9306 4 жыл бұрын
Perfect for what i need, good luck with the next videos!
@murtazasworkshop
@murtazasworkshop 4 жыл бұрын
Thank you
@sujitvasanth2502
@sujitvasanth2502 3 жыл бұрын
wonderful ! I love this - i didn't know opencv ad bui;t in trackers...your code is perfect..
@rashasalim1259
@rashasalim1259 2 жыл бұрын
Thanks! This was really informative I would like to ask you for advice in case I needed the speed estimate of the moving object. Thanks!
@LeonardoJPaes
@LeonardoJPaes Жыл бұрын
wow!! awesome tutorial. Thank you very much for your explanation and the way of introducing the subject and all the useful tools for beginners like me!
@karthikeyaanar
@karthikeyaanar 2 жыл бұрын
Excellent Tutorial. Keep it up !!!
@jollysaintthicc3920
@jollysaintthicc3920 3 жыл бұрын
Love your stuff! keep up the good work!!!
@Not0rious7
@Not0rious7 3 жыл бұрын
Seriously, good work!!! This is a great intro.
@murtazasworkshop
@murtazasworkshop 3 жыл бұрын
Glad you like it!
@oleksandrromaniuk3557
@oleksandrromaniuk3557 Жыл бұрын
Thank you very much, very clear and with life example!
@leojax3275
@leojax3275 2 жыл бұрын
Thank You Good Sir. Very good tutorial, very helpful. Have a wonderful day!
@ingokaminski935
@ingokaminski935 2 жыл бұрын
This helps me a lot... 👍 Thank you!!!
@selcukmisir2399
@selcukmisir2399 3 жыл бұрын
Great videos again and again! Thanks
@douwebdevries
@douwebdevries 4 жыл бұрын
When you get this error: OpenCV: camera failed to properly initialize! Try changing cap = cv2.VideoCapture(1) to cap = cv2.VideoCapture(0)
@1phong.djk.392
@1phong.djk.392 4 жыл бұрын
Thank you very much for upload wonderful tutorials. Keep going
@murtazasworkshop
@murtazasworkshop 4 жыл бұрын
You are welcome 😊
@fahimkamalahmed3544
@fahimkamalahmed3544 3 жыл бұрын
Simple but clear explanation. Thank you ☺️
@murtazasworkshop
@murtazasworkshop 3 жыл бұрын
You are welcome 😊
@rodrigobucrin7912
@rodrigobucrin7912 4 жыл бұрын
Thank you for your quality contributions!
@murtazasworkshop
@murtazasworkshop 4 жыл бұрын
Glad you like them!
@CrjaseMechaEngr
@CrjaseMechaEngr 2 жыл бұрын
Thank you. Great tutorial.
@sankasuvarna1764
@sankasuvarna1764 3 жыл бұрын
Hi sir u can label the names the tracked images so that will be much better any way this is also a superb tutorial
@ohnoooooo3831
@ohnoooooo3831 4 жыл бұрын
hey thanks. but if we have the same problem with the trackerCSRT_create but on spyder(anacondaà. how can we solve it ?
@teezhenquan5855
@teezhenquan5855 2 жыл бұрын
Love your work. Can you share tracking with C++ as well
@ssaniljainn
@ssaniljainn 2 жыл бұрын
Can you make a tutorial on Kalman Filters? Especially in object tracking for state estimation and in some cases, for the velocity estimation. The whole Computer Vision world, it seems, is looking out for the subject to be more implementable if clear. Would be grateful if you could do the honors :)
@selenaycakc9584
@selenaycakc9584 3 жыл бұрын
Great thanks Sir! I have a question: how can I add a custom trained model to this code? can anyone help me? my own model is ready with yolov4.
@AbdullahJirjees
@AbdullahJirjees 3 жыл бұрын
Hi, thanks a lot for this tutorial, I am following exactly what you doing but when I draw the square on the object it keeps showing LOST status, I am using VS Code and I installed pip install opencv-contrib-python to my environment. what I am missing??
@fqdqwdqw
@fqdqwdqw 3 жыл бұрын
Is it possible to do this using 2 cameras, perpendicular to each other, showing the XY coordinate for one and YZ on the other?
@kj4051
@kj4051 3 жыл бұрын
Thanks for great project. But how to get cv2.selectROI while in the loop?
@DerinMalik
@DerinMalik Ай бұрын
thanks you open new goals to us
@hemanthy2835
@hemanthy2835 3 жыл бұрын
For the same application can we have a circular tracker instead of a rectangular one? If so, how?
@josueperrit
@josueperrit 2 жыл бұрын
Is there a way to know the first frame at which the bbox starts moving?
@thienduyen2518
@thienduyen2518 3 жыл бұрын
Thanks Pro!
@milesgiehtbrock8510
@milesgiehtbrock8510 3 жыл бұрын
how do we implement trackers into robotics? The output coordinates tell a robot arm to go to that position for example.
@ahmadmaleh
@ahmadmaleh 3 жыл бұрын
Hi, Is it possible to know all pixels of the detected object? because I want to change the object color after that.
@technoshamanarchist
@technoshamanarchist 2 жыл бұрын
Thank you for this wonderful tutorial! However, the page for the code is no longer available :(
@shivadumnawar7741
@shivadumnawar7741 3 жыл бұрын
Thank you sir.
@manoubilahbib2572
@manoubilahbib2572 Жыл бұрын
Hey ! How can i install the package that contains all the trackers on thonny python IDE because i am using a raspberry pi ?
@ponrajs5396
@ponrajs5396 3 жыл бұрын
Hi bro, how could I count no of object in the frame with tracking.
@nadiamumtaz6270
@nadiamumtaz6270 3 жыл бұрын
Thanks for sharing but i m facing one issue, that it misses the target but still says tracking instead of lost? Why
@santoshgujar5237
@santoshgujar5237 2 жыл бұрын
Thank you, Sir
@aronhegedus
@aronhegedus 2 жыл бұрын
really useful tutorial, thank you! It would. be useful for beginners to tell them where they could go if they get stuck (google, or documentation)
@easonvictor3749
@easonvictor3749 2 жыл бұрын
speaking of which, do you know why my external camera wouldn't pick up any feed besides the gray void of absolotly nothin?
@Quasarss
@Quasarss 3 жыл бұрын
can get x y z of center of the track box?
@havehalkow
@havehalkow 3 жыл бұрын
I'm not using PyCharm but Sublime Text and CMD. I pip installed the opencv-contrib-python package which was successfully done, however the error is still there
@saltanatseitzhan625
@saltanatseitzhan625 3 жыл бұрын
great video! also, how could one track multiple objects?
@dompower500
@dompower500 3 жыл бұрын
Dear Sir, I am following all your training videos. Excellent and easy to follow. I always get positive result too. There are many tranining videos available in youtube for the same subject. But your videos are the best and error free. Thank you very much sir. My request: Pls can you also make a traning video for car license plate recognition using TF? thanks in advance. Also pls provide your email sir.
@tjssr8261
@tjssr8261 2 жыл бұрын
Sir, this video helped me a lot. Thank you so much. I am using Spyder for Python. Where can I see the values of the x, y ,w and h in my window? PLease help me sir.
@sanketyeru
@sanketyeru 4 жыл бұрын
Your videos are awesome. I would like to request you to make a video on yolo detector combined with object tracker.
@murtazasworkshop
@murtazasworkshop 4 жыл бұрын
Thank you . I will look into it.
@yashwantdave4452
@yashwantdave4452 4 жыл бұрын
you've manage to do that ?
@coolprojects5297
@coolprojects5297 2 жыл бұрын
Thank you for nice work,,, but please when I run the code it stuck and the camera did not update the view why did this happen?
@prajjwal1642
@prajjwal1642 2 жыл бұрын
sorry sir but the cv2.TrackerMOSSE_create() function is not working in other ide s. can you give an alternative? also a request to build a project on social distancing using opencv
@lobdooks
@lobdooks 3 жыл бұрын
For some reason after I click "enter" when I select an object to track it gives me the error message for "cv.rectangle(img,(x,y),((x+w... (that thing)" that says "TypeError: function takes exactly 4 arguments (2 given)" how do I fix this?
@josephadamu2723
@josephadamu2723 4 жыл бұрын
hello please i have a question concerning filters (gaussian, median, bilateral and averaging) associated with OpenCV. I have seen some tutorials using gaussian blur for object detection i would like to know why this particular filter is used for object detection, why is it the best and what are the features that differ from other 3 filters that i have mentioned.
@murtazasworkshop
@murtazasworkshop 4 жыл бұрын
Median Filter is to remove Salt Pepper Noise Bilateral gives a painting feel. It uses weighted average of surrounding pixels. Guassian filter uses convolution . This means futher pixels get lower weights Averaging. uses single averaged value for all surrounding pixels. It depends on the situation . Guassian is good but it is slower than Averaging.
@dennisasamoah2213
@dennisasamoah2213 3 жыл бұрын
great video as always
@murtazasworkshop
@murtazasworkshop 3 жыл бұрын
Thanks again!
@thienduyen2518
@thienduyen2518 3 жыл бұрын
You are the Best! Haha!
@thaibaohuynh1298
@thaibaohuynh1298 Жыл бұрын
Can you share the video you used to test?
@enarm5947
@enarm5947 3 жыл бұрын
"Status: Tracking" shows when the tracker is working, but when it loses an object. Is the "status" changing?
@AjibesinSamson
@AjibesinSamson 2 жыл бұрын
If I want to track objects in a video and make use of a detector such as YOLOv4, how can I go about it?
@yashdggjs
@yashdggjs 4 жыл бұрын
who are you mannn who are you awesome workss,ı really admire you
@murtazasworkshop
@murtazasworkshop 4 жыл бұрын
Thank you so much 😀
@siddharthrana512
@siddharthrana512 Жыл бұрын
any course of computer vision include person tracking under multiple overlapping cameras , so that there id does not change when they move from one camera to other.
@amitdutta3875
@amitdutta3875 3 жыл бұрын
Is its possible to calculate distance using openCV???
@pinehteshapple3666
@pinehteshapple3666 3 жыл бұрын
can we use mobile camera instead of webcam
@aykutsirma4260
@aykutsirma4260 3 жыл бұрын
tracker = cv2.TrackerMOSSE_create() AttributeError: module 'cv2.cv2' has no attribute 'TrackerMOSSE_create' I have installed opencv-contrib-python as first and I have installed opencv-python too. However, once I uninstall the opencv-python and keep the opencv-contrib-python. Then python compiler gives error about "You don't have cv2"... Do you know how to solve this issue? thank you.
@nishantgarg3688
@nishantgarg3688 2 жыл бұрын
thanks bhai
@samirakhrif3098
@samirakhrif3098 3 жыл бұрын
hello.please can you enplane in video haw calcul speed of the cars
@shaikrasool1316
@shaikrasool1316 3 жыл бұрын
Sir, make video on Instagram filter .. Replace eye brow..
@theengineered1949
@theengineered1949 2 жыл бұрын
Wonderful video. I am trying to make a motor move using the tracked object. How do you export the x,y,w,h ?
@famayman6858
@famayman6858 2 жыл бұрын
+1
@zack-ow9yl
@zack-ow9yl 3 жыл бұрын
I am not able to add the OpenCV package because the plus sign isn't highlighted when I click "Python Interpreter." Also, can you make a video on tracking multiple objects at once?
@satya5561
@satya5561 3 жыл бұрын
Can you please help me to find vision based vibration on any object using python
@almostworthy2973
@almostworthy2973 3 жыл бұрын
hey how do i do the same but my source is a mp4 file.
@flexiadmin
@flexiadmin 8 ай бұрын
awesome tutorial for my plane crazy plane ciws tracking
@SAMETELMACI
@SAMETELMACI 3 жыл бұрын
ı have a vs code, can ı use this, because ı still error like about 6:33
@bilalahmadai
@bilalahmadai 3 жыл бұрын
Kindly sir make video on gestures for mouse
@alexhernandez8550
@alexhernandez8550 3 жыл бұрын
some advice I would not recommend using cv2 to capture the screen use mss also I would try PyGLM or numpy for better performance .
@murtazasworkshop
@murtazasworkshop 3 жыл бұрын
Thanx for the advice. will try it out.
@gregoryM101
@gregoryM101 3 жыл бұрын
Can you save these selected object for tracking and reuse it without having to select it again? Perhaps set up a library of objects that can be reused as needed?
@murtazasworkshop
@murtazasworkshop 3 жыл бұрын
usually its detection and then tracking. so if tracking is lost detection can kick in again. The selected region could be saved but since tracking is sensitive to variance you might not get good results.
@lusher00
@lusher00 2 жыл бұрын
selectROI only gives me a black box to draw on. Even if I just select a black region is continues to show me a black frame.
@ezisol
@ezisol 3 жыл бұрын
bro can u make tuts for ip camera face recognition
@oladapoafolabi274
@oladapoafolabi274 8 ай бұрын
I want to learn how to set up Robot arm performing orientation identification, pick and place cube object using artificial intelligence in webots simulation environment
@nouramged5765
@nouramged5765 3 жыл бұрын
I don’t hava web camera and i want to use my phone’s camera how can i do that?
@user-xo2iu8ne3j
@user-xo2iu8ne3j 2 жыл бұрын
Doesn't this program determine the distance?
@mustafaaslan1520
@mustafaaslan1520 Жыл бұрын
i use win 10 and help me pls cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\highgui\src\window.cpp:1267: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Cocoa support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function 'cvShowImage'
@HabibTitas
@HabibTitas 3 жыл бұрын
Hello there, thanks for the nice tutorial. btw, import cv2 # Create a VideoCapture object and read from input file cap = cv2.VideoCapture('example.mp4') . How can a file browser so that we can select file for CV2 to capture. Any suggestion of QFiledialog would be great. -TA
@murtazasworkshop
@murtazasworkshop 3 жыл бұрын
for that u need a different library like tinker or pyqt
@elixpo
@elixpo 2 жыл бұрын
I am not getting the open-cv contrib, it always says not available even after downloading by PIP too
@afifabinteislam4675
@afifabinteislam4675 2 жыл бұрын
And when I installed OpenCV-contrib-python for the first time, my video was not capturing and I got panicked. then uninstalled it and installed it again. then it worked. I don't know any other way to solve the issue. if you do, please let me know
@1wanqo1
@1wanqo1 3 жыл бұрын
cap = cv2.VideoCapture(0, cv2.CAP_MSMF)
@twinklewolf6794
@twinklewolf6794 4 жыл бұрын
Awesome keep going🔥🔥 But why did u delete arduino tutorial?
@murtazasworkshop
@murtazasworkshop 4 жыл бұрын
Thanx. They are not ready yet
@twinklewolf6794
@twinklewolf6794 4 жыл бұрын
@@murtazasworkshop so when you finish them all u gonna upload them again? hope so cuz those two videos were amazing tutorial to be honest❤️
@murtazasworkshop
@murtazasworkshop 4 жыл бұрын
@@twinklewolf6794 Yes
@twinklewolf6794
@twinklewolf6794 4 жыл бұрын
@@murtazasworkshop Can't wait 🔥🔥🔥
@shravannanjunda1565
@shravannanjunda1565 4 жыл бұрын
If it was controlled with servo motors ...pan and tilt it would be awesome
@murtazasworkshop
@murtazasworkshop 4 жыл бұрын
ill look into that
@munibmarwan
@munibmarwan Жыл бұрын
I'm trying to work on something similar ..
@munibmarwan
@munibmarwan Жыл бұрын
@@murtazasworkshop I'm trying to work on something similar, is there anything you can add might help me to take the first step in it? .. Thank you for your time.
@abeerilyas8337
@abeerilyas8337 3 ай бұрын
Sir, I would like some suggestion. How can we implement this if the object is moving and we are doing real time tracking?
@amr6657
@amr6657 2 жыл бұрын
how to reset tracker init without restart program?
@hetthummar9582
@hetthummar9582 3 жыл бұрын
if you get error " You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded. Restarting kernel... " 1. Make sure opencv-contrib-python-headless is installed (pip install opencv-contrib-python-headless) 2. opencv-python, opencv-python-headless and opencv-contrib-python-headless version has to be same (For check version just write pip list|grep opencv-python) In my case all version are 4.3.0.36 (pip install opencv-contrib-python-headless==4.3.0.36)
@playfifalikeapro9773
@playfifalikeapro9773 3 жыл бұрын
thanks so much i just wanna ask you when I wanna run the code I see the error module 'cv2.cv2' has no attribute 'TrackerMOSSE_create' I am using Spyder IDE and I cant solve it plz help me thanks in advance
@PolarUVTeam
@PolarUVTeam 3 жыл бұрын
Try tracker = cv2.legacy.TrackerMOSSE_create() and use only opencv-contrib-python library
@SAMETELMACI
@SAMETELMACI 3 жыл бұрын
thanks, where is this procects code
@TECHNICALHUBInfo
@TECHNICALHUBInfo 3 жыл бұрын
Hello sir. Sir how to detect any bird or any small object plzzz guide me
@A3A3adamsan
@A3A3adamsan 3 жыл бұрын
Even after adding opencv-contrib-python package (version 4.5), no MOSSE tracker was found, only MIL and GOTURN. Anyone knows why?
@anuraagsaxena7942
@anuraagsaxena7942 3 жыл бұрын
change tracker = cv2.legacy_TrackerMOSSE.create() this might help
@bhanukadasanayaka3457
@bhanukadasanayaka3457 3 жыл бұрын
@@anuraagsaxena7942 Thanks bro
@abeatperday9189
@abeatperday9189 3 жыл бұрын
@@anuraagsaxena7942 thanks for this, it worked for me
@jishnupillai5295
@jishnupillai5295 3 жыл бұрын
@@anuraagsaxena7942 thanks for this..it really helped. So what changes to be made if we are using another tracker?
@vinayakdhinde5606
@vinayakdhinde5606 3 жыл бұрын
@@anuraagsaxena7942 Thanks Bro , It's working
@jaswanthd1027
@jaswanthd1027 3 жыл бұрын
hi !! when i run the app it is showing only blue screen.It is not showing my video. i am using droidCam for my video. what i should do now.
@romanregmi1332
@romanregmi1332 2 жыл бұрын
Did you solve this?
@ksagar90
@ksagar90 3 жыл бұрын
I understood init part. But, when tracker fails to update. then it is required to init tracker with new box. and In opencv if we try to init the tracker which is already was init once. It says fail. How to reinit tracker ? Any idea.
@murtazasworkshop
@murtazasworkshop 3 жыл бұрын
Normally tracking is done along side detection. so whenever tracking fails we use detection to find the object again
@bimonugraraga3065
@bimonugraraga3065 4 жыл бұрын
Sir, is w and h the size of the box or the size of the real object?
@murtazasworkshop
@murtazasworkshop 3 жыл бұрын
box
@j4s0n67
@j4s0n67 3 жыл бұрын
how do you install opencv2-contrib-pyhton on terminal?
@abhaysharma1139
@abhaysharma1139 3 жыл бұрын
just type "pip install opencv-contrib-pyhton" in your command prompt
@HadronCollisionYT
@HadronCollisionYT 3 жыл бұрын
Can we make circle instead of box for tracking
@murtazasworkshop
@murtazasworkshop 3 жыл бұрын
I don't believe that option is available.
How to Detect QRCode and BarCode using OpenCV in Python + Project
23:45
Murtaza's Workshop - Robotics and AI
Рет қаралды 153 М.
格斗裁判暴力执法!#fighting #shorts
00:15
武林之巅
Рет қаралды 15 МЛН
Не пей газировку у мамы в машине
00:28
Даша Боровик
Рет қаралды 4,1 МЛН
skibidi toilet 73 (part 2)
04:15
DaFuq!?Boom!
Рет қаралды 31 МЛН
Object Tracking from scratch with OpenCV and Python
1:00:13
Pysource
Рет қаралды 227 М.
OPTICAL MARK RECOGNITION (OMR) MCQ Automated Grading- OpenCV Python
1:53:26
Murtaza's Workshop - Robotics and AI
Рет қаралды 138 М.
Build an Object Detector for Any Game Using YOLO
22:40
Moises de Paulo Dias
Рет қаралды 28 М.
OpenAI’s GPT-4o: The Best AI Is Now Free!
9:14
Two Minute Papers
Рет қаралды 158 М.
Text Detection with OpenCV in Python | OCR using Tesseract (2020)
28:36
Murtaza's Workshop - Robotics and AI
Рет қаралды 414 М.
How DeepSORT Works?
16:28
Augmented AI
Рет қаралды 59 М.
Object Detection in 10 minutes with YOLOv5 & Python!
10:45
Rob Mulla
Рет қаралды 210 М.
格斗裁判暴力执法!#fighting #shorts
00:15
武林之巅
Рет қаралды 15 МЛН