Haar Cascade Object Detection Face & Eye - OpenCV with Python for Image and Video Analysis 16

  Рет қаралды 667,866

sentdex

sentdex

Күн бұрын

In this OpenCV with Python tutorial, we're going to discuss object detection with Haar Cascades. We'll do face and eye detection to start. In order to do object recognition/detection with cascade files, you first need cascade files. For the extremely popular tasks, these already exist. Detecting things like faces, cars, smiles, eyes, and license plates for example are all pretty prevalent.
First, I will show you how to use these cascade files, then I will show you how to embark on creating your very own cascades, so that you can detect any object you want, which is pretty darn cool!
You can use Google to find various Haar Cascades of things you may want to detect. You shouldn't have too much trouble finding the aforementioned types. We will use a Face cascade and Eye cascade. You can find a few more at the root directory of Haar cascades. Note the license for using/distributing these Haar Cascades.
text-based tutorial and sample code: pythonprogramm...
pythonprogramm...
/ sentdex
/ pythonprogramming.net
plus.google.co...

Пікірлер: 807
@rahard
@rahard 6 жыл бұрын
for those who are having errors, I found out that when downloading the Haar Cascades through the link, sometimes it saves the file(s) as HTML (not XML). make sure it is NOT saved as HTML. check the first line of the file. originally I saved the link by using web browser, it saved it as HTML. then I just clone the link through git command. got everything (in another directory though, just copy them). it works. I hope it helps. this is a cool video tutorial. love it.
@jodumagpi
@jodumagpi 8 жыл бұрын
you are such a big help to my final project
@sentdex
@sentdex 8 жыл бұрын
Great! Best wishes on your project.
@adriandeveraaa
@adriandeveraaa 6 жыл бұрын
what class whats that project for?
@asadullah3129
@asadullah3129 4 жыл бұрын
Plz tell me about your final project
@Dylan-qk8ss
@Dylan-qk8ss 8 жыл бұрын
"Morbidity aside, you aren't going to find eyes outside your face." - you made my day sir
@geoffreyhuntoon4409
@geoffreyhuntoon4409 7 жыл бұрын
The entire series up to this point was worth it for the Haar pun.
@geoffreyhuntoon4409
@geoffreyhuntoon4409 7 жыл бұрын
I mean, it's been extremely helpful, too, but the puns really make it. :)
@lilbastards7885
@lilbastards7885 8 жыл бұрын
Hey, Harrison! Your channel is the Python: The Definitive guide on the internet. Literally everything I am not sure about, I can find the answer in one of your videos! Yesterday I found out I will need to learn some OpenCV for one of my projects. I came straight to Sentdex and bingo! How come you still don't have 100K subscribers? I don't get it. :) Thanks for sharing your knowledge!
@sentdex
@sentdex 8 жыл бұрын
+Soundscrap Glad to hear you are enjoying the tutorials! I enjoy doing them. Maybe 100K subs some time in 2016 :P
@shoebmoin10
@shoebmoin10 6 жыл бұрын
To avoid mouth being considered as eye we can consider ROI as just upper 70% of the face ,Therefore : roi = frame[ y:int((y+h)*0.7) , x:x+w ]
@shailendrapandit440
@shailendrapandit440 5 жыл бұрын
roi_gray = gray[y:y-int((y + h) * 0.7), x:x + w] roi_color = img[y:y-int((y + h) * 0.7), x:x + w] right way to do it
@bennguyen1325
@bennguyen1325 4 жыл бұрын
@@shailendrapandit440 Thanks sir.
@sonalisahoo5170
@sonalisahoo5170 4 жыл бұрын
@@shailendrapandit440 what does these two lines mean?? Even the tutor didnt explain about it..so pls do help @takeTech @Shoeb Moin
@zlls
@zlls 4 жыл бұрын
​@@sonalisahoo5170 It means you're grabbing from y to the 70% of the height and from X to X + W (width). It's a little bit complicated to explain
@rogzam
@rogzam 6 жыл бұрын
"If you laughed, I appreciate it"... hahah, love this tutorials!
@JohnnyRottenest
@JohnnyRottenest 8 жыл бұрын
Great videos. I watch all the time, just want to tell you I appreciate that you cover advanced (for me at least) and useful topics.
@tylersnard
@tylersnard 4 жыл бұрын
That was SO FAST! Usuall these tutorials take hours, I got it up and running in 5 minutes! Thank you!
@tylersnard
@tylersnard 4 жыл бұрын
@maryam I've never used spyder IDE. But I think you could modify the code to work on a video instead of webcam
@tylersnard
@tylersnard 4 жыл бұрын
@Maryam Ashraf kzbin.info/www/bejne/fpumpnyJfcdsjac Does this help?
@abdullahsaif4859
@abdullahsaif4859 7 жыл бұрын
Hi, got this error< any help :( face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') TypeError: 'str' object is not callable
@sunOOconuresOOrock
@sunOOconuresOOrock 7 жыл бұрын
Sounds like perhaps the file wasn't found? Ensure the .xml is saved in the same directory as your script, with case sensitive naming. It is possible to call it from another directory but I generally find it's one less possible problem on small scales like this to just put it all in the same bowl and eat with a big spoon I guess you could say. No need to dig for each file we are using.
@FairPlayGaming
@FairPlayGaming 4 жыл бұрын
Just in case anyone has problems the cascades; use this code instead: face_Cascade = cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_alt.xml")
@blanktbd4958
@blanktbd4958 4 жыл бұрын
thank bro
@diegodibelardino7149
@diegodibelardino7149 5 жыл бұрын
listen... you're the best at it... I really want to learn image analysis and I'm sure none is gonna explain better than you... but in this tutorial you missed to explain some part of the program like you usually do in your other tutorial... in fact in some part I'm really getting lost...
@Caique12392
@Caique12392 5 жыл бұрын
Hello! I'm from Brazil and I just finishing the course of computer engineering and this video helped me a lot to complete my project, thank you! I'll subscribe to your channel
@CariagaXIII
@CariagaXIII 7 жыл бұрын
if you are having problems add. incase you're cascade is on a different location import os os.chdir("C:/Users/cariaga/Documents/haarcascades") on top right before face_cascade = cv2.CascadeClassifier('haarcascade_frontalface_default.xml') eye_cascade = cv2.CascadeClassifier('haarcascade_eye.xml')
@jonesman1308
@jonesman1308 6 жыл бұрын
sentdex you're prob not going to read this but we have to do a project in university where we need to something with augmented reality so we stumbeld upon your video, and as it turns out the guy you're using the haar cascades from is our professor who's guiding/grading our project :D
@sentdex
@sentdex 6 жыл бұрын
Haha, small world :)
@ellemagic3856
@ellemagic3856 7 жыл бұрын
Thank you sir! You are very helpful and generous in sharing your codes with others :)
@csdc4891
@csdc4891 8 жыл бұрын
Your tutorials are very helpful :) waiting for the next video as it is going to help me a lot :) :)
@amitabhphatak
@amitabhphatak 5 жыл бұрын
Just ran my first face detection program.Thanks a lot !
@sentdex
@sentdex 5 жыл бұрын
Woo!
@borjasanchez3137
@borjasanchez3137 6 жыл бұрын
i love you, you saved my final project of the degree
@vaishnavivaishu8338
@vaishnavivaishu8338 4 жыл бұрын
Love your way of teaching😘😘
@MikeAirforce111
@MikeAirforce111 7 жыл бұрын
Love your bad taste in humor :D thx for the vid bro!
@dhaves
@dhaves 8 жыл бұрын
I can't laugh because i still dont know how hard will be create my cascades! Amazing work, btw!
@abdeen91
@abdeen91 7 жыл бұрын
your channel is heavenly! everything is just awesome!!
@sentdex
@sentdex 7 жыл бұрын
Thanks!
@divadbate
@divadbate 8 жыл бұрын
just subbed...I am so going to binge watch your videos tonight :P
@sentdex
@sentdex 8 жыл бұрын
+divadbate Thanks for joining us!
@urs_rkm
@urs_rkm 8 жыл бұрын
how to enhance this detection into recognition. i.e., displaying the name of the person after detecting the face(on bounding box).
@ItsGlizda
@ItsGlizda 7 жыл бұрын
Maybe convolutional neural network?
@marcone1338
@marcone1338 6 жыл бұрын
Can you help me with this? Traceback (most recent call last): File "C:/Users/Marcone/Desktop/Marcone/ex001.py", line 12, in gray = cv2.cvtColor(img, cv2.COLOR_BRG2GRAY) AttributeError: module 'cv2.cv2' has no attribute 'COLOR_BRG2GRAY'
@umangahuja1
@umangahuja1 6 жыл бұрын
CH4pI3 it's BGR2GRAY and not BRG2GRAY
@tanmayagarwal1356
@tanmayagarwal1356 4 жыл бұрын
"If you laughed, I appreciate" ... LOL that was amazing!! ... N i actually laughed LOL
@yonatantasew3070
@yonatantasew3070 8 жыл бұрын
your face detection code works perfectly and i was wondering if you are planning to make a face recognition tutorial any time soon or at all. Oh and u r awesome!!!
@SpikyCat
@SpikyCat 8 жыл бұрын
Can you do something on Neural Evolution in python?
@matheusrodrigues-kf6pj
@matheusrodrigues-kf6pj 3 жыл бұрын
you're so intelligent and funny man, thanks for the videos
@burhansancakl351
@burhansancakl351 5 жыл бұрын
5:03 there is some nice drum going on in the background :D
@00ShiNoda
@00ShiNoda 5 жыл бұрын
müptezel cihat nikiyle python tutorialı izlemek baya sıradışı bi olay reis fdsfad
@natchakaphondukhlim6514
@natchakaphondukhlim6514 7 жыл бұрын
Error gray = cv2.cvtColor(img, cv2.COLOR_BRG2GRAY) Attribure Error:Module ''cv2' has no attribute 'COLOR_BRG2GRAY'
@natchakaphondukhlim6514
@natchakaphondukhlim6514 7 жыл бұрын
i'm key valid COLOR_BGR2GRAY (COLOR_BRG2GRAY) ha ha
@kevinvidzzz5393
@kevinvidzzz5393 7 жыл бұрын
You don't wanna find "eyes" outside of a "face" . . . . very funny stuff
@selvakd7103
@selvakd7103 6 жыл бұрын
Hi... I have one doubt Why i need to convert frame color mode bgr to grayscale. ? "gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)" Without using this ,it runs successfully it deducts my face ? Then why i need to use this ?
@denissetiawan3645
@denissetiawan3645 5 жыл бұрын
simplify the algorithm and reduce computational power requirements
@decoortega4136
@decoortega4136 5 жыл бұрын
??
@jsquared5730
@jsquared5730 6 жыл бұрын
U R amazing i can now track objects from my drone
@kuaranir2440
@kuaranir2440 2 жыл бұрын
Great tutorial👍
@dr4gon743
@dr4gon743 8 жыл бұрын
Amazing tutorial! Loved it.
@naeemayoub1534
@naeemayoub1534 6 жыл бұрын
you are really awesome, i am learning a lot from your videos. keep it up. thanks for sharing your knowledge.
@YadishareTutorial
@YadishareTutorial 7 жыл бұрын
very nice tutorial...thanks
@ayushagarwal69
@ayushagarwal69 3 жыл бұрын
so funny when he says " my mouth is also probably an eye " XD
@techm3825
@techm3825 5 жыл бұрын
Teach how make identification of the user. I saw a video of u about it... and I did not understand much... I'm Brazilian and study English hehehe.. but I like so much of u job!! Congratulations!! I wait your answer.
@sharonshaju1872
@sharonshaju1872 7 жыл бұрын
Hey sir! I've been working on a project for the blind people and yea your tutorials is just great! can i have some personal attention of yours please? i really understand the way you teach.
7 жыл бұрын
can it determine different ppl or that just that they all have faces? i want to identify with face recognition for home automation?
@RishabhGoyal
@RishabhGoyal 6 жыл бұрын
Suggesting a modification. Because we are using the ROI of face to detect the eyes within that ROI, when the lower half of the face is out of frame, the eye will never get detected.
@1368dainn
@1368dainn 8 жыл бұрын
Thanks for the tutorial it was great. I was wondering if I'm using raspberry pi camera module, will cap = cv2.VideoCapture(0) work? Sorry I'm still a beginner and want to detect cars using haar cascade.
@adarshsn8728
@adarshsn8728 6 жыл бұрын
Really helpful tutorial. keep up the good work.
@wernekinhoo
@wernekinhoo 5 жыл бұрын
Traceback (most recent call last): File "C:\Users\Cauã Wernek\Desktop\calc\faceviewer.py", line 13, in faces = face_cascade.detectMultiScale(gray, 1.3, 5) NameError: name 'face_cascade' is not defined error pls fix
@lucaspetersen5074
@lucaspetersen5074 5 жыл бұрын
Show more of your code
@wilgeraleman7940
@wilgeraleman7940 5 жыл бұрын
that because you havent define the right path of your haar files in the code
@nurbolbizhigit2557
@nurbolbizhigit2557 5 жыл бұрын
That is epic,dude.Thank you for your this informative videos
@kuldeepchaturvedi1894
@kuldeepchaturvedi1894 7 жыл бұрын
it's not showing the rectangle why? :( please help about that i am using Ubuntu...
@yehonatanpeleg7637
@yehonatanpeleg7637 4 жыл бұрын
great tutorial
@amey97
@amey97 Жыл бұрын
Thank You!!
@vasusharma1192
@vasusharma1192 5 жыл бұрын
Why did you take y co-ordinate first in roi_gray and roi_color...
@SaimonThapa
@SaimonThapa 2 жыл бұрын
i laughed at your haar cascade joke :D
@ronakjain4690
@ronakjain4690 7 жыл бұрын
it is very helpful for my assignment.. Thanx Buddy
@dwang2805
@dwang2805 4 жыл бұрын
U can try to increase the value of 'minNeighbors' to increase accuracy, you code will become: faces = face_cascade.detectMultiScale(gray, 1.3, 10)
@moritzpainz1839
@moritzpainz1839 4 жыл бұрын
nice adjustment. Can you help me with my understanding problem? i have an understanding problem with this code. with the following code: for (ex, ey, ew, eh) in eyes: cv2.rectangle(roi_color, (ex, ey), (ex + ew, ey+eh),(0,255,0),2) with this code we draw every eye(s) detected on the roi_color, since the first parameter is the image we draw our rectangle on. At the end we say cv2.imshow("img", img). Now with which line do we say draw the eyes on this img that we later show?? greedings from germany
@evanmaltz6103
@evanmaltz6103 8 жыл бұрын
Hi sentdex, Thank you so much for this! Is there a way to do the same type of object recognition in a list of images rather than from a video feed? Thanks!
@grizanmariyanayagam6324
@grizanmariyanayagam6324 5 жыл бұрын
What's algorithm for you use for this detection?
@hackingoffensive8425
@hackingoffensive8425 5 жыл бұрын
viola jones algorithm
@neatville7629
@neatville7629 8 жыл бұрын
The output from the code I ran from this tutorial was extremely slow - maybe my Lenovo Yoga 2 isn't fast enough for this kind of thing. C++ is known to be a lot faster than Python, but can anyone tell me if that would likely make a difference with OpenCV.
@abeerchaudhry8808
@abeerchaudhry8808 4 жыл бұрын
I've been at it for 5 hours now. I can't figure out why I'm, getting this error: (-215:Assertion failed) !empty() in function 'cv::CascadeClassifier::detectMultiScale' I've tried almost everything, but something escapes me I think. I've read almost every relatable post on StackExchange and other similar forums. Can anybody suggest anything?
@andreivilla9009
@andreivilla9009 4 жыл бұрын
have you installed opencv-python through pip?
@abeerchaudhry8808
@abeerchaudhry8808 4 жыл бұрын
@@andreivilla9009 I'm actually using Pycharm. I've downloaded OpenCv but since there are.a lot of OpenCvs in the directory I don't know which one will work
@andreivilla9009
@andreivilla9009 4 жыл бұрын
@@abeerchaudhry8808 I actually found out that running this use case on Pycharm will not work, I found some forums that Pycharm has some bug. I ran into this because I wasn't able to load my camera through Pycharm. The best bet would be to run this on the terminal with a new environment, alternatively you could try using vscode, that may take an hour to get set up tho
@ganeshbhosale9544
@ganeshbhosale9544 4 жыл бұрын
@@andreivilla9009 yes
@jaiyesh007
@jaiyesh007 7 жыл бұрын
Thanks Bro you saved me i used your code from your page and its working fine.
@InspirationalQuotes480
@InspirationalQuotes480 7 жыл бұрын
hi, i am trying to run this code and i got this error, Traceback (most recent call last): File "C:\Users\Lenovo\Desktop\camerapro.py", line 13, in faces = face_cascade.detectMultiScale(gray, 1.3, 5) error: C:\builds\master_PackSlaveAddon-win32-vc12-static\opencv\modules\objdetect\src\cascadedetect.cpp:1634: error: (-215) !empty() in function cv::CascadeClassifier::detectMultiScale Do you know what is the problem?
@gianfrancodagostino3938
@gianfrancodagostino3938 5 жыл бұрын
Pure gold!!! THANK YOU!
@technicalilm8999
@technicalilm8999 7 жыл бұрын
Your videos are amazing ..
@edlynx9078
@edlynx9078 4 жыл бұрын
Been watching your videos. What do you recommend using for commercial use on facial recognition?
@Fiand.s
@Fiand.s 5 жыл бұрын
thanks for your video tutorial so finally my project is done
@paulinamoras9108
@paulinamoras9108 5 жыл бұрын
Did you use the same haar cascade files from the link of 3 years ago?
@Faiskhanhacker
@Faiskhanhacker 5 жыл бұрын
what if i want to detect change like : in simple A4 type : i put hole on it through pencil / and want to detect latest change : suppose 4 whole were already there , and if there is new one hole occurs it should highlight... I hope u got my problem ? any hint on that ? pleass
@amandaye2331
@amandaye2331 8 жыл бұрын
Thanks a lot! By the way, which version of OpenCV and Python are you using ?
@17jhoow
@17jhoow 8 жыл бұрын
thank you so much for you videos!!! They are easy to follow and helped me a lot! I'm so happy that my face detector is working hahah
@sentdex
@sentdex 8 жыл бұрын
Happy to share!
@adib0078full
@adib0078full 7 жыл бұрын
dude you're such an inspiration !
@sentdex
@sentdex 7 жыл бұрын
@kopuz.co.uk.
@kopuz.co.uk. 7 жыл бұрын
Nice video! This is like a real life ESP. I wonder if people use a similar method for a game ESP.
@kristascerri5715
@kristascerri5715 7 жыл бұрын
hi , my webcam is switching on but it is not being displayed . did anyone have this problem ? thanks
@ashwinypraba9608
@ashwinypraba9608 7 жыл бұрын
Hi, I have the same problem. Did you figure out what has to be done?
@bidhanry9740
@bidhanry9740 5 жыл бұрын
@@ashwinypraba9608 same problem could u pls help me krista or praba anyone...if you have any soln.
@jafar1607
@jafar1607 7 жыл бұрын
I actually laughed for that smile...!!! :)
@ACArguson
@ACArguson 5 жыл бұрын
Nice video tutorial. I was hoping if you could give an advise a new method on how to detect rules of thirds on a photograph using OpenCV? Thanks in advance.
@xXConstancex
@xXConstancex 5 жыл бұрын
Hi! Thanks for the guide. Do you have a guide to help with putting a label to the person in front of the webcam?
@yanlidong519
@yanlidong519 5 жыл бұрын
Thanks for your wonderful videos! I have one question: why convert img to gray? I change faces = face_cascade.detectMultiScale(gray) to faces = face_cascade.detectMultiScale(img), still work. So, I think we don't need convert. Am I right?
@burhansancakl351
@burhansancakl351 5 жыл бұрын
its probably faster
@andreivilla9009
@andreivilla9009 4 жыл бұрын
Yup makes it faster because there are less color channels (rgb is three, grayscale is one) to process.
@sumedhaagarwal7890
@sumedhaagarwal7890 7 жыл бұрын
Hey Sentdex, I have been working on a project for detecting traffic signs and I was wondering how many negatives and positives will suffice? Any source for getting the negatives?
@ashwinibukegar6244
@ashwinibukegar6244 5 жыл бұрын
error: OpenCV(4.1.0) ..\modules\imgproc\src\color.cpp:182: error: (-215:Assertion failed) !_src.empty() in function 'cv::cvtColor' got this error please help me solving this.
@yakkalakesavavenkatasai
@yakkalakesavavenkatasai 5 жыл бұрын
try to change the number in video caputure for example in my case i changed to '0' where as '1' is there in this video cap = cv2.VideoCapture(0)
@ashwinibukegar6244
@ashwinibukegar6244 5 жыл бұрын
@@yakkalakesavavenkatasai okay sir thanku i will try with this.
@joojoo1020
@joojoo1020 5 жыл бұрын
Hi, Thank you for your wonderful work. What would be the "BEST" camera to get for this type of projects? Is it the more resolution the better? What do you recommend under $45
@jt_mmxx
@jt_mmxx 4 жыл бұрын
Pi cam
@vallabh2803
@vallabh2803 6 жыл бұрын
Awesome !!! Thanks for this video.. :)
@vikingsraven
@vikingsraven 8 жыл бұрын
cheers for doing these videos, its making sense now. got a problem with the xmls though, it keeps saying file should start
@CaimAstraea
@CaimAstraea 6 жыл бұрын
shouldn't . the output in imshow be grayscale ? since we converted it in gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
@raflialhamdi7898
@raflialhamdi7898 5 жыл бұрын
nice video dude
@premrajs683
@premrajs683 5 жыл бұрын
We are using stretch and VNC viewer, our videos are having very low frame rates and has about 3 seconds latency, will remote desktop reduce the latency
@anupamyedida5484
@anupamyedida5484 8 жыл бұрын
really good video man ! Keep it up !!! :)
@suttikarnsrilanon3091
@suttikarnsrilanon3091 8 жыл бұрын
when i use full code but python say Traceback (most recent call last): File "C:\Python27\project.py", line 16, in faces = face_cascade.detectMultiScale(gray, 1.3, 5) error: C:\builds\master_PackSlaveAddon-win32-vc12-static\opencv\modules\objdetect\src\cascadedetect.cpp:1639: error: (-215) !empty() in function cv::CascadeClassifier::detectMultiScale what it mean guy
@OctavioTosta
@OctavioTosta 8 жыл бұрын
i think your OpenCv installation is wrong... should have all cascades...
@Sarah7asan
@Sarah7asan 7 жыл бұрын
I have the same problem... Did you find out how to solve it?
@OctavioTosta
@OctavioTosta 7 жыл бұрын
I find, this is a problem in opencv, wen opencv is compiling by make. I think you can reinstall opencv with opencv contrib (plus modules)
@Sarah7asan
@Sarah7asan 7 жыл бұрын
Octavio Tosta I'll try it thanx a lot
@OctavioTosta
@OctavioTosta 7 жыл бұрын
welcome
@Am3r1Kan0
@Am3r1Kan0 8 жыл бұрын
Hello, this video was very helpful and it works great, but I'd just like to ask you if there is any possible way to detect when you close your eyes. I'm trying to write a sleep detection program that sends a signal to the user when he is falling asleep, and I've been having an issue when trying to detect when the eye is closed. Thank you
@DipenBabariya
@DipenBabariya 6 жыл бұрын
Hey, I'm Big fan of yours, Can you make a tutorial on Face Recognition? I've learned face Detection but now i want to learn Live Face Recognition but don't know which is best method for that. Thank You!
@RohitRSharma2002
@RohitRSharma2002 4 жыл бұрын
I'm trying to make a haar cascade of my own but I want it to only detect my face and nobody else's. So I'm assuming that positive images should include my face but if so then shouldn't negative images have faces of other people, so that's it's able to differentiate between them and I?
@Mrbotosty
@Mrbotosty 5 жыл бұрын
When I run the program, in the output screen I only get a static image with the detected rectangles and not a live video output . Is it the constraints of my computer or something else??
@andrewkwon2460
@andrewkwon2460 7 жыл бұрын
I have a problem. I put a print statement where the rectangles are supposed to be creating using cv.rectangle and the print statement never gets executed. Is it because of the for loop conditions?
@tamaldas3544
@tamaldas3544 7 жыл бұрын
thanks for this beautiful tutorial....
@mdmahedihassan2444
@mdmahedihassan2444 3 жыл бұрын
Hi, can you please tell me, in which software he wrote the code
@shadmanfaysal5797
@shadmanfaysal5797 7 жыл бұрын
I am using Laptop camera (no external camera ) for me it only opens camera window but not detected any face I save this project where all the xml file exist and i have also try cap = cv2.VideoCapture(value) where value=0,1,2,3,4,5 problem still exist plz help
@ceritaamir2482
@ceritaamir2482 5 жыл бұрын
Hi bro. May i know the max distance between the camera and the driver? And the camera must exactly infront of driver or can be side a bit?
@ItsRanaJee
@ItsRanaJee 8 жыл бұрын
Hi, great videos. I am beginner to Python and learning a lot for your videos. For object detection, I might try to work on a project of 'fruit counting' on the tree, birds counting etc. I was watching one TED talk regarding future of robotics, their they mentioned that small robot / drone can be used for fruit counting or from the top of the tree to monitor regarding pesticide or others... From there, I thought if I can count with my smart phone :)
@vineetkumar2396
@vineetkumar2396 7 жыл бұрын
Great help, thank you very much. Can you suggest how to detect pupil using the same method?
@shoravsuriyal5954
@shoravsuriyal5954 7 жыл бұрын
now its working thanks guys
@ZeroTwoTwoFive
@ZeroTwoTwoFive 4 жыл бұрын
Hi I am using IPython and Jupyter notebook to run the code. But the video streaming and detection is very slow. Any idea what might be the issue?
@malvinedward9513
@malvinedward9513 7 жыл бұрын
May I ask one thing. I need to compare if the picture wif it's converted to hsv not grayscale. When i convert to hsv, the face won't detected. Can you help me explain why it won't detected?
@alejanserna
@alejanserna 8 жыл бұрын
Thanks for the video, amazing! My question is why did you apply faces to the gray image? why not to the color img? why did we do the cvtcolor to gray? Thanks
@sentdex
@sentdex 8 жыл бұрын
+Alejandro Serna allowing there to be colors means exponentially far more variables
@brainbeantechnolabs8648
@brainbeantechnolabs8648 7 жыл бұрын
Does it affect on result! ????
@sentdex
@sentdex 7 жыл бұрын
Try it and find out. See what happens. That's how you learn.
@naghechebilal7269
@naghechebilal7269 6 жыл бұрын
i think that the gray scale image means less data processed
@jean4j_
@jean4j_ 5 жыл бұрын
@@naghechebilal7269 Colored images have 3 channels (R,G,B), gray images only have one. Using gray images makes the problem easier and the computation faster.
@NaraaErik
@NaraaErik 6 жыл бұрын
I got "OpenCV Error: Unknown error code -49" How to solve this error?
@kartikjoshi772
@kartikjoshi772 4 жыл бұрын
@sentdex plz help with this.
@kimvathanak9564
@kimvathanak9564 4 жыл бұрын
Basically it is because you didn’t install and setup the open cv or maybe it just your project couldn’t locate the folder or file.
@cheapbuster
@cheapbuster 7 жыл бұрын
My camera is mounted upside down so is there any way to invert the video and also set the resolution?
@harshgawai1078
@harshgawai1078 4 жыл бұрын
How to display only bounding box region in original image and black out other pixels?
@anilgurung641
@anilgurung641 5 жыл бұрын
nice tutorial. How would you write a text('face_detected') on the screen when face is detected. Under 1st forloop, i tried like (if w>0): then cv2.putText....., but didn't work. Any suggestions?
[Python] Введение в распознавание контуров через OpenCV
10:30
BeTry | Программирование
Рет қаралды 14 М.
Cute
00:16
Oyuncak Avı
Рет қаралды 11 МЛН
МАИНКРАФТ В РЕАЛЬНОЙ ЖИЗНИ!🌍 @Mikecrab
00:31
⚡️КАН АНДРЕЙ⚡️
Рет қаралды 39 МЛН
25   Object Detection with HAAR Cascade Classifiers
7:11
exter minar
Рет қаралды 12 М.
Video Data Processing with Python and OpenCV
32:05
Rob Mulla
Рет қаралды 76 М.
Object-Oriented Programming is Bad
44:35
Brian Will
Рет қаралды 2,3 МЛН
What La Niña Will do to Earth in 2025
19:03
Astrum
Рет қаралды 560 М.
Can I Run Youtube Entirely From My Terminal? (No Browser)
15:31
Object Detection in 10 minutes with YOLOv5 & Python!
10:45
Rob Mulla
Рет қаралды 261 М.
How the Best Hackers Learn Their Craft
42:46
RSA Conference
Рет қаралды 2,6 МЛН
Training a Cascade Classifier - OpenCV Object Detection in Games #8
32:29
Learn Code By Gaming
Рет қаралды 153 М.
Auto-Measuring with OpenCV + Python - Try It Yourself
25:17
Clayton Darwin
Рет қаралды 86 М.