Raspberry Pi LESSON 62: Track Faces in OpenCV with a Pan/Tilt Camera

แชร์
ฝัง
  • เผยแพร่เมื่อ 12 ส.ค. 2024
  • Moving forward we will now want to move the camera (pan/tilt) in response to the movement of the object of interest. I do this using the Sunfounder pan/tilt hat. You can order the hat I am using at this affiliate amazon link:
    amzn.to/3JWH7vp
    If you are able, I suggest you consider getting some spare servos for the pan tilt hat. During development if you are not careful, it is possible to damage a servo by crashing the camera into something. I like to keep a couple spares on hand:
    amzn.to/3E1KZaN
    Announcing the Most Awesome Raspberry Pi Lessons of All Times! This time we RUMBLE!
    In this class series, we will be using the most excellent Sunfounder Ultimate Raspberry Pi kit, available here: (Affiliate Link)
    amzn.to/3tSk9Mo
    or for our UK friends, amzn.to/3I5d401
    In today's video I will show you how to find and track faces and eyes in openCV on the Raspberry Pi using Haar Cascades. I show how to find, track, and box the face and then the eyes. Then we also activate the pan/tilt hat, and point the camera to keep the FOI (Face of Interest) in the center of the frame.
    If you want to grab those cool little straight jumper wires I am using to keep my breadboard builds neat and clean you can snag a box of them here:
    amzn.to/36NyfHq
    If you guys are interested in the oscilloscope I am using, you can pick one up here (affiliate link):
    amzn.to/3v13Mhl
    You guys get your hardware ordered so you can follow along at home!
    You will also need a Raspberry Pi. I suggest the Raspberry Pi 4. If you do not already have one, this is the most suitable gear I could find:
    amzn.to/3pBMfKm
    The Raspberry Pi's are sort of pricy right now, so you can look on ebay or elsewhere to see if there are any deals. You will need a SD card. If you do not already have one, this is a good one:
    amzn.to/3KcXTn2
    I like using a wireless keyboard and mouse to have fewer wires. You can certainly use your USB keyboard and mouse, but if you want a nice wireless one, this one works on the pi. We demonstrate this by using a button switch to control a LED.
    amzn.to/36Rv9Sk
    You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:
    / paulmcwhorter
    #pantilt
    #opencv
    #raspberrypi
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 43

  • @akinatie2557
    @akinatie2557 5 หลายเดือนก่อน

    Thank you for your lessons. its like my learning journey is linked to you somehow. i got started with your lessons many years ago. now im getting into openCV and here you are again. Thanks so much from the bottom of my heart

  • @pralaymajumdar1206
    @pralaymajumdar1206 7 หลายเดือนก่อน

    Outstanding lesson as well as outstanding place where you stay or live...
    As far as knowledge of technology is concerned you are just amazing...

  • @stephenlightkep1621
    @stephenlightkep1621 10 หลายเดือนก่อน +1

    Thanks Paul. This is so cool.

  • @WhiteError37
    @WhiteError37 11 หลายเดือนก่อน

    I have just come by your YT channel. Haven't actually followed anything as it's 00:15 XD love your vibe though

  • @cbrombaugh
    @cbrombaugh ปีที่แล้ว

    Thanks for this most-excellent lesson Paul. I really appreciate the effort and time you devote to your tutorials.

  • @Ducerobot
    @Ducerobot ปีที่แล้ว +1

    After going throught the nano and the other videos im convinced you know everything in the world cool video 😁👍

  • @sahrishmemmon4409
    @sahrishmemmon4409 8 หลายเดือนก่อน

    Paul, Wonderful lesson. I really appreciate your work.Can we implement face recognition part in this code? How to do that?

  • @leeg.1402
    @leeg.1402 ปีที่แล้ว +2

    Paul, Have you given any thought to continuing the A.I. series using a Jetson Nano, allowing us to get into more advanced topics? I think just a quick review of how to get set up on the Nano would suffice and then we could jump into the A.I. stuff. Of course, this assumes most people would be familiar with the Jetson Nano. Just a thought… Thanks for all you do in providing the lessons on the Pi and Arduino.

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว +1

      Lee, I really want to do a new series on the NVIDIA Jetson nano or orin. The challenge in my mind is many have gone through these Rpi lessons, and my python lessons and such and would be ready to jump right in, but others would not have that background, so how to sequence the videos to not bore the experienced guys but not lose the new guys. Still thinking through it.

  • @sinaghadimi1804
    @sinaghadimi1804 ปีที่แล้ว

    Hey Paul, I love your videos, i started watching and you trach so good, I am on lesson 12 but I'm getting here! thank youuuuuuuuuuuuu

  • @alistaircook1997
    @alistaircook1997 ปีที่แล้ว

    Thank you for quick reply, was using my raspberry pi 3 getting low frame rates,in last lessons, I now have a radxa-4c+ and I am going to have a go with this.

  • @scottwait3585
    @scottwait3585 ปีที่แล้ว

    Thanks Paul!

  • @mariomarais5644
    @mariomarais5644 ปีที่แล้ว

    Thanks Paul!!

  • @kalidabdul6862
    @kalidabdul6862 ปีที่แล้ว

    Always the best paul

  • @claviclvl3
    @claviclvl3 4 หลายเดือนก่อน

    Is there a way to isolate the largest rectangle similar to what was done for the contours a few lessons back? I haven't quite tested the camera with multiple faces but I would imagine it would go a bit crazy focusing on each face as you step through the list.

  • @munibmarwan
    @munibmarwan 8 หลายเดือนก่อน

    Hello Mr.Paul, First of all i would like to thank you for your efforts to teach us such knowledge, it's a more then a good lesson.
    I appreciate the time you spent on this, and i would like to ask you about the Pan Tilt error handling, in my project i used PID to adjust my Pan Tilt and im still trying to configure it to centroied the object and reducing the overshooting of the servos, but i noticed that you didn't use it here and at the same time it worked perfectly to centroied the face in the center of the frame, my question is, could i use ROI + CSRT insted of face tracking Algorithm keeping the pan tilt error handling the same as it is in the tutorial?, would it give me the same results about keeping the selected object in the center of the frame as long as the loop works? just to be clear im also using PCA9685 as a servos driver.
    Thank you again for your efforts and time, i would like to hear you suggestions about it as soon as possible.

  • @charlotteswift
    @charlotteswift ปีที่แล้ว +2

    Hi Paul & Guys
    I have tried to leave a comment here with a link to one of my videos but it keeps getting deleted. I have made a video called FaceDetect in the hope that someone with good lighting etc could try my idea for getting a better fps rate. I cannot get my camera to detect me very well (probably because I have my back to the window in order to reach the keyboard) and my husband is never available to be my model because he is also the gardener. The video is on my channel in the Raspberry Pi for Absolute Beginners playlist. Any input would be gratefully received.

    • @qzorn4440
      @qzorn4440 ปีที่แล้ว

      I have the same comment issue of leaving sample 'Orange Pi-5' [20FPS] code and it is gone the next day? Bummer!

  • @ginabolle4307
    @ginabolle4307 ปีที่แล้ว

    Wonderful! Thank you for the lessons, I've learned so much. I am wondering: Is it possible to run the script and at the same time stream to another device via RTSP protocol? I have been using MediaMTX on my Rpi but it seems like it's either the script or RTSP stream :-/ Thank you so much!

  • @kekekeernest8920
    @kekekeernest8920 ปีที่แล้ว

    Hello Paul, aren't we going to continue with the fusion 360 lesson? 😢

  • @alistaircook1997
    @alistaircook1997 ปีที่แล้ว

    Great series again, thank you for a the great content. What will be the name to look out for this new series of classes, is it still "Free Raspberry Pi Tutorials for Absolute Beginners"
    or Raspberry Pi LESSON ?

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว

      This same class is continueing. Next video will be released next thursday as always.

  • @imadjawad4408
    @imadjawad4408 ปีที่แล้ว

    Hi Paul thanks for your time! this can be done on the Jetson Nano with few mods right?

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว

      Yes things will be mostly the same on the Jetson nano

  • @kalagecko77
    @kalagecko77 ปีที่แล้ว

    Hey Paul, thank you again for another great lesson!
    I have one question regarding processing speed:
    I did implement the frame capturing using a class and using an additional thread for capturing the frames. It runs pretty fast and gives me an amazing fps.
    For the sake of organization I've just put servo control in another class. But only by initializing servo class the fps drops incredibly to 0 or 1.
    Could You please help me? I'd really want to understand why it is so.
    Thank you!

    • @kalagecko77
      @kalagecko77 ปีที่แล้ว

      Hey Paul, my solution was using a class with slots. Thx

  • @alldaypancakes7058
    @alldaypancakes7058 ปีที่แล้ว

    you shold post on your other chanell it will be fun to se you other than programing

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว

      Yes, I have been doing lots of work in sustainable agriculture, raising rabbits, chickens and organic farming. Really wish I had time to update my other channels.

  • @marktorbett3207
    @marktorbett3207 ปีที่แล้ว

    Will the raspberry pi 4 with 8GB of ram do the openCV Lessons planned? The 3B+ that I'm using will only do 7fps at 640X360.

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว

      The raspberry pi 4 would be faster, but really we are getting to the point of needing more power than what the pis have.

    • @marktorbett3207
      @marktorbett3207 ปีที่แล้ว

      @@paulmcwhorter Thanks for your response it's not what I wanted to hear but I probably will get it anyway! These Lessons are great and I can't wait for the next one. I really appreciate you for sharing your knowledge and time to teach us this cutting edge course! Thank you!

  • @marktorbett3207
    @marktorbett3207 ปีที่แล้ว

    When will more Lessons be available?

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว +1

      As always, lessons are released each Thursday. Schedule will continue.

  • @kalidabdul6862
    @kalidabdul6862 ปีที่แล้ว

    Is face recognition and media pipe coming for the pi

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว +1

      Next I am going to show how to do object detection using tensor flow light. Then, we will do mediapipe after that.

    • @kalidabdul6862
      @kalidabdul6862 ปีที่แล้ว

      @@paulmcwhorter wonderful

  • @henkoegema6390
    @henkoegema6390 ปีที่แล้ว

    Can't I keep the same card for the next lesson and use a virtual environment to do what you are going to install on a new card?

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว

      openCV in not python code, so it does not operate inside a virtual environment. Really, I think you need to do this next part on a fresh 64 bit bullseye card.

    • @henkoegema6390
      @henkoegema6390 ปีที่แล้ว

      @@paulmcwhorter openCV operates perfectly well inside a virtual environment.

    • @paulmcwhorter
      @paulmcwhorter  ปีที่แล้ว

      You do not understand. You can not run a different version of openCV in a virtual environment. Your system will have one version of openCV. It is not a python library, so does not exist within the virtual environment.

    • @henkoegema6390
      @henkoegema6390 ปีที่แล้ว

      @@paulmcwhorter Ok.
      Thanks Paul. 😊

  • @peterkarlsson7801
    @peterkarlsson7801 ปีที่แล้ว

    I am legend