Raspberry Pi LESSON 45: Using the Raspberry Pi Camera in Bullseye with OpenCV

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 ม.ค. 2023
  • 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 this lesson I will show you how to use the Raspberry Pi camera on the Bullseye operating system, in either 32 bit or 64 bit mode. I will show you how to operate the camera using OpenCV.
    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
    [Disclosure of Material Connection: I am a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com. ]
    #bullseye
    #opencv
    #raspberrypi
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @AronAyub
    @AronAyub ปีที่แล้ว +13

    Hi Proff, you taught me a lot back then when I was a fresher in my early career journey, 7 years ago. Now I'm an Electrical/Electronic Engineer working as an IoT/AI Solutions dev and a tutor. Lot of thanks and I salute you !

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

      Well done! Congratulations on your success.

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

      @@paulmcwhorter forever grateful !

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

    Thanks Paul. What I love about these courses is that it ties together classes I took in the past.

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

    thank you for this valuable lesson

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

    Its perfect and the best pick. I tried 10 -15 videos , this gave me the desired output
    ☺☺☺☺☺

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

    Thanks for this interesting new way of using the Pi camera. 😀

  • @paulzhu8436
    @paulzhu8436 6 หลายเดือนก่อน

    Paul, you are awesome!

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

    Hi Paul. This is awesome!
    It is hard to keep up during the summer, but I'm trying to catch up. Thanks again.

  • @user-xh7fq8vt9f
    @user-xh7fq8vt9f 8 หลายเดือนก่อน

    excellent Video - got the camera working in minutes

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

    you're just amazing ! Thank you very much ❤️

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

    This is exciting stuff. Looking forward to seeing where you take us from here.

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

    It is great to see the Pi camera come to life! Having done the FPS calculation in the AI course, it was a pretty quick addition to the Pi lesson. I am seeing around 18 FPS. It looks good, but is not the 30 FPS that Paul expected. Thanks for the great lesson Paul!

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

    That was a lot of fun, thanks for your effort and great video production.

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

      Things get fun now we can use the camera.

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

    OMG,you are my lifesaver,I tried so much ways including pi camera2 face detection program on their official repo but idk it is not working for me,but you are rockingg,Thankyou Somuuchh.If didn't saw this video my last opt was to restart all from 32bit os which will drain my entire work on 64bit.Once Thank you Paul

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

    thank you very much Mr. Paul you're awesome :)

  • @Michael197155
    @Michael197155 3 หลายเดือนก่อน

    Thanks Paul. I like this video training course. It's useful.

    • @paulmcwhorter
      @paulmcwhorter  3 หลายเดือนก่อน

      Glad you like it

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

    Thanks a lot sir,.
    I was trying to connect the camera since last two day, But You code is so simple. I don't know why, But I was not getting any blog regarding the same.
    Thanks again

  • @RicardoMaciasYepez6913
    @RicardoMaciasYepez6913 6 หลายเดือนก่อน +1

    A lot of thanks you made my University carrer a lot easier, masive thanks proff!!!

    • @paulmcwhorter
      @paulmcwhorter  6 หลายเดือนก่อน

      Glad to hear that!

  • @markbooco1719
    @markbooco1719 ปีที่แล้ว +5

    Excellent lesson. Python would not work until I had to updated my bullseye firmware to get libcamera library by using: sudo rpi-update.
    Also, updated /boot/config.txt file with the following changes:
    #start_x=1
    camera_auto_detect=1
    gpu_mem=256
    Found libcamera-hello command was a good way to confirm camera is wired up correctly.

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

      I am still getting " no camera available" when I am testing with libcamera-hello ..any suggestions..?

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

    Ok i got it working 😁👍i don't know what it was i couldn't find it . But it works ❤

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

    Great lesson today! Will be working on updating my bullseye and doing homework and getting pico w loaded with micropython. I am up for live stream tomorrow night!!

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

    Hi Paul, Another high value session. I will be trying to add camera to my current Pico W project and expect this knowledge will be transferrable to Pico. Best regards, Ed

    • @Gerald-iz7mv
      @Gerald-iz7mv ปีที่แล้ว

      I think you cant use pico with raspberry pi camera modules…

  • @RobertWood-mg4ro
    @RobertWood-mg4ro ปีที่แล้ว +1

    I have followed you loosely on many of your posts. Arduino, Fusion 360, etc. You're an excellent teacher. I find all of your content intriguing and I normally browse your posts as my hobby needs dictate. Thank you for all you do. Unfortunately, I popped into this lesson w/o fully understanding the 64-bit operating repercussions. As a heads up for any of your followers. If they do not install the 64-bit version, i.e. go with default settings on the PI page even though it is a 'fresh install'; they will not be successful in installing the CV-2. At some level I thought the 64-bit vs 32 would just be a performance Hicky...but no...the files structures, etc. are a bit different. Anyway, you earned a Patrion visit from me. Just for the pure tenacity of putting that all together for us. If only I would have popped into lesson 44 1st * smile * . Please keep up the good fight. Rob

  • @BerndBraun-qp9dt
    @BerndBraun-qp9dt ปีที่แล้ว +2

    Hello Paul. I enjoy your tutorial in this series very much here in Solingen in Germany. Thanks al lot for that. As I'm using Visual Studio Code on my PC, I was very pleased to see that in bullseye this is shown as a Recommended Software. So I installed it and it works very fine with all that very helpfull stuff in programming. It makes coding much easier than in Geany or Thony, which of course I tried as well. Perhaps it's usefull for your community to know that and try that tool. Best regards Bernd

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

      Thanks Bernd und grüße aus Wuppertal!

    • @schmelpe
      @schmelpe 10 หลายเดือนก่อน

      Grüße aus Mettmann… 😃

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

    Hi Paul,
    Thanks for the series. Ive learned a ton. One small note to others watching the new 5 pi cables from this kit dont fit a raspberry pi 5 slot as it is to small.

    • @paulmcwhorter
      @paulmcwhorter  5 หลายเดือนก่อน +1

      These lessons are better suited for earlier version of the Pi. The 5 is really trying to become more of a desktop type machine, and less of an embedded platform. Maybe pickup a used, earlier version of the pi for the class.

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

      Thanks for the response! I have enjoyed the class a lot and learned a ton.
      Would a raspberry 3 work for this class or only a 4?
      Thanks!

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

    on the fps script, I had to remove the line picam2.preview_configuration.controls.FrameRate=30 to obtain the video with FPS. I am using the USB camera from your previous AI series on the pi400 and obtain FPS of about 20.

  • @Gerald-iz7mv
    @Gerald-iz7mv ปีที่แล้ว

    Hi nice video. Do you have a like to the pir sensor you mention?

  • @user-vk8yn5xm7j
    @user-vk8yn5xm7j 10 หลายเดือนก่อน +2

    Lesson 45 new 64bit Pi added downloads as instructed . Python echoed 3.9.2 cv2 echoed 4.6.0 vcgencmd getcamera returns zeros
    Run program I get :
    Traceback (most recent call last):
    File "", line 3, in
    File "/usr/lib/python3/dist-packages/picamera2/picamera2.py", line 254, in __init__
    raise RuntimeError("Camera __init__ sequence did not complete.")
    RuntimeError: Camera __init__ sequence did not complete.
    I even copy paste you program Same thing. Paul love you videos and you are a great teacher.
    Also configuration on the new 64 bit Bullseye does not show option to select camera , Should it ?
    Just need someone outthere to point me in the right direction .

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

    I now have three CSI cameras. I tested each of them and the results are listed below. I did notice some lag, but I was using VNC viewer. I dont have a spare screen to verify if that is the cause of the lag. I set the start time prior to the capture statement and the end time after the show statement. I then increment the frame count and add the calculated frame time to the total time. After quit, I divide the frame count by the total time to get the FPS.
    Arducam Camera OV5647
    5MP 1080P day/night
    FPS Res
    31.04 1920X1080
    44.44 1280X720
    24.01 480x360
    Sunfounder Camera
    FPS Res
    30.238 1920X1080
    48.939 1280X720
    19.371 480x360
    Raspberry Pi Camera V2
    FPS Res
    35.809 1920X1080
    65.226 1280X720
    40.724 480x360

  • @EnergySeeker
    @EnergySeeker 6 หลายเดือนก่อน

    nice ideo i love it , can we put this video in format mjpeg and how ? and one more question can we stream that video and how , thanks

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

    Think I got the home work. I also tried different resolutions. When I went to 640x360 seems to slow my fps but not as much as 1920x1080. Thanks for this lesson.

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

    Hello Paul. Firstly thank you for putting on these great tutorials. I am having a problem with lesson 45, Getting some errors when installing opencv. Is there somewhere I can go to get assistance? Thank you in advance. Vic

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

    Hello Paul, Thank you very much for the video. I have a doubt regarding the camera module. So, I am trying to use ROS on Raspberry pi to build a RC Car due to which I had to install Ubuntu on my Raspberry pi. However, the camera that I have (Freenove 8MP) does get detected by Raspberry pi but does not capture any frames. Can you please assist what I should do in this case?

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

    Can i use this in a virtual enviornment?

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

    Hi Paul, the recommended Raspberry Pi kit is not available currently on Amazon. Any other kit you might recommend for compatibility with your tutorials.

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

    Hey, i am working in a virtual environment. I successfully installed cv2 library in it, but I am unable to install Picamera2 library. Can you help. Thanks

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

    i do not have a pi camera, I am using a USB webcam instead, what shoud i change in my code to get the same results.

  • @burakay3609
    @burakay3609 2 หลายเดือนก่อน

    it's working but the footage I am getting looks zoomed. any solutions?

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

    Hi sir, I'm doing a project, for now, can you help me? How can I enable two web cameras at the same time?

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

    Paul just completed 1 thru 44 no issues went great. THANKS Now lesson 45 I installed cv2 as shown in lesson 45
    Says sucessfully installed . If type python it says not found. If I type python3 details are show. When I type import cv2 i get the same error as the other student import error can not open shared drives .
    Please advised im lost. 1 to 44 went great

    • @user-vk8yn5xm7j
      @user-vk8yn5xm7j 10 หลายเดือนก่อน

      Found the issue. Had not installed 64 bit yet. Folded like a cheap WM lawn chair

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

    Homework posted th-cam.com/video/c6Jr0tHpXKc/w-d-xo.html
    I also show my design of a holder for the Pi Cam and included the Fusion 360 file in the description. I also added a little show and tell of what I have been up to over the holidays.

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

    Hi,
    Many thanks for one more excellent tutorial.
    I have followed the instructions using the Raspberry Pi HQ camera.
    It all works smoothly, however, it looks like the Red and the Blue channels are interchanged.
    Blue things look Red, Red things look Blue, and Green things look Green (as well as white).
    Looks like an RGB BGR issue.
    Do you have any idea what's wrong?
    Thanks.
    Nahum Budin.

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

      To prove the interchanging, the following fixes the display: frame[:, :, [2,0] = frame[:, :, [0,2]]. Nahum.

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

    I fired up a new my newly delivered RPi 4B today. I tried to install opencv as I did last on my older 4B running Bullseye and it didn't work. A newer version of opencv is available. I installed opencv without specifying the version number and I didn't get any errors installing it. pip install opencv-python

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

      The possible issue will come in that we will be on different versions of opencv, and will my future demos work on your version. I would really try and see if you can get my version installed, that would be safest.

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

    Hi Paul, first of all thank you for your time and very useful tutorials. Could you put somewhere source code of program you created on tutorials?

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

      No, my objective is to teach people to code, and do not want to tempt people to just copy and paste my code.

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

      @@paulmcwhorter Once again thank you for your time.

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

    if you ever need an idea on lessons, im trying to learn something called ROS to run on a raspberry pi

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

      I have tried ROS several times and found it very frustrating.

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

    So far so good, but what if you use OpenCV to open the camera and grab a frame. Did you find a solution, why it's not possible to use cv2.VideoCapture(-1, cv2.CAP_V4L2)

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

    Hello I tried this but I can’t get a good frame rate even if I lowered my resolution. I get around 20fps when I reduce the resolution to 360x360. Please help me fix this guys. Thanks in advance.

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

    A shift to Python from Debian Linux enabling expanding market for Pi Camera for the several knock-off SBC on the market today. RaspberryPiOrg, et al, showing lack of loyalty by not including the breadth of required code to operate PiCam with Bullseye before its release.🤬
    Backward compatibility is a fable.
    looking anxiously for saving video to file??

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

    I cannot seem to catch up. I am on 14. Can start here or is there stuff I really need to know before I start this lesson

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

      This is sort of a late place to start. I would try to do the earlier lessons.

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

    Hey Paul, I have completed your Arduino series and am now looking to get into this series. I just have one question, can I complete this series with the pi 4 model b or does it have to be the pi 4 model a. Thanks.

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

    Does picamera2 have the possibility to access two different cameras in one script? Would be nice to know!

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

      I think it is possible but would run slow with two cameras

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

      @@paulmcwhorter Thanks for the Response. What would you recommend for using 2 cameras?

  • @BrianBeam-nl4lw
    @BrianBeam-nl4lw ปีที่แล้ว +1

    Hello all. All went well with no errors until i type "import cv2" i get " ImportError: libcblas.so.3: cannot open shared object file: no such file or directory" any suggestions

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

    Greetings from Nigeria, did you use Python programming language for the pi camera

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

    Hi Paul, I wonder if you have a Discord server to get in touch with followers of the channel. They work great to share and ask for help on common topics of interest.

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

      No, just too much to try and moderate and monitor a discord server. Maybe at some point.

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

    Here is an update to my homework for lesson 45, th-cam.com/video/FMmEJTisfFA/w-d-xo.html

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

    Here is link to my homework for this lesson, th-cam.com/video/5r9Raz-hIlM/w-d-xo.html. There was a considerable amount of head scratching to get it done. Thanks Paul for doing these videos.

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

      James, nice work, but I think you are not getting an accurate number. There are lots of lines of code not between your two measurements of time. You need as much of the loop code as possible between these two lines of code, as each line takes some time to execute, and hence code not between your two time measureuments are not being accounted for. Nice work, think on it a little more.

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

    Another great learning exercise, Paul! Here is the link to my homework: th-cam.com/video/iEcdQCwPulo/w-d-xo.html
    I cannot figure out why I am only measuring about 15 fps. I took out the print statement that I was using for troubleshooting, but surprisingly, that doesn't do anything to the fps.

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

    Homework th-cam.com/users/shortsH0ovfTPWvVM?si=eC-46tTcvTullI43
    FPS is based on lighting