Тёмный

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

Paul McWhorter
Подписаться 378 тыс.
Просмотров 33 тыс.
50% 1

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

Наука

Опубликовано:

 

18 янв 2023

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 95   
@AronAyub
@AronAyub Год назад
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 Год назад
Well done! Congratulations on your success.
@AronAyub
@AronAyub Год назад
@@paulmcwhorter forever grateful !
@stephenlightkep1621
@stephenlightkep1621 10 месяцев назад
Thanks Paul. What I love about these courses is that it ties together classes I took in the past.
@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.
@eei2036
@eei2036 9 месяцев назад
Its perfect and the best pick. I tried 10 -15 videos , this gave me the desired output ☺☺☺☺☺
@stefan_balint_youtube
@stefan_balint_youtube 9 месяцев назад
thank you for this valuable lesson
@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.
@henkoegema6390
@henkoegema6390 Год назад
Thanks for this interesting new way of using the Pi camera. 😀
@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!
@tntragan
@tntragan Год назад
This is exciting stuff. Looking forward to seeing where you take us from here.
@RicardoMaciasYepez6913
@RicardoMaciasYepez6913 7 месяцев назад
A lot of thanks you made my University carrer a lot easier, masive thanks proff!!!
@paulmcwhorter
@paulmcwhorter 7 месяцев назад
Glad to hear that!
@oussamabenmazhar5365
@oussamabenmazhar5365 Год назад
you're just amazing ! Thank you very much ❤️
@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
@user-xh7fq8vt9f
@user-xh7fq8vt9f 9 месяцев назад
excellent Video - got the camera working in minutes
@paulzhu8436
@paulzhu8436 7 месяцев назад
Paul, you are awesome!
@lontongtepungroti2777
@lontongtepungroti2777 9 месяцев назад
thank you very much Mr. Paul you're awesome :)
@Michael197155
@Michael197155 4 месяца назад
Thanks Paul. I like this video training course. It's useful.
@paulmcwhorter
@paulmcwhorter 4 месяца назад
Glad you like it
@markbooco1719
@markbooco1719 Год назад
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 2 месяца назад
I am still getting " no camera available" when I am testing with libcamera-hello ..any suggestions..?
@training_demo
@training_demo 6 месяцев назад
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
@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!!
@paulmcwhorter
@paulmcwhorter Год назад
Sounds great!
@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 Год назад
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
@Ducerobot
@Ducerobot Год назад
Ok i got it working 😁👍i don't know what it was i couldn't find it . But it works ❤
@user-vk8yn5xm7j
@user-vk8yn5xm7j 11 месяцев назад
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 Год назад
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 7 месяцев назад
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
@BerndBraun-qp9dt
@BerndBraun-qp9dt Год назад
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 Год назад
Thanks Bernd und grüße aus Wuppertal!
@schmelpe
@schmelpe 11 месяцев назад
Grüße aus Mettmann… 😃
@Gerald-iz7mv
@Gerald-iz7mv Год назад
Hi nice video. Do you have a like to the pir sensor you mention?
@PM_Ace
@PM_Ace 6 месяцев назад
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 6 месяцев назад
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 6 месяцев назад
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!
@cadmanof50s
@cadmanof50s 5 месяцев назад
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
@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.
@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.
@paulmcwhorter
@paulmcwhorter Год назад
Nice work!
@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?
@user-vk8yn5xm7j
@user-vk8yn5xm7j 11 месяцев назад
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 11 месяцев назад
Found the issue. Had not installed 64 bit yet. Folded like a cheap WM lawn chair
@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.
@carloscoelho7790
@carloscoelho7790 9 месяцев назад
Can i use this in a virtual enviornment?
@arihantsinghi9110
@arihantsinghi9110 8 месяцев назад
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
@burakay3609
@burakay3609 3 месяца назад
it's working but the footage I am getting looks zoomed. any solutions?
@niveshagarwal9849
@niveshagarwal9849 2 месяца назад
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.
@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?
@marcindyba4774
@marcindyba4774 10 месяцев назад
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 10 месяцев назад
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 10 месяцев назад
@@paulmcwhorter Once again thank you for your time.
@budinnahum9081
@budinnahum9081 Год назад
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 Год назад
To prove the interchanging, the following fixes the display: frame[:, :, [2,0] = frame[:, :, [0,2]]. Nahum.
@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.
@paulmcwhorter
@paulmcwhorter Год назад
Either should work.
@humanperson2798
@humanperson2798 Год назад
@@paulmcwhorter thankyou Paul🙏
@keithlohmeyer
@keithlohmeyer Год назад
Homework posted ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-c6Jr0tHpXKc.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.
@paulmcwhorter
@paulmcwhorter Год назад
LEGEND!
@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.
@chinthanakarunathilake9759
@chinthanakarunathilake9759 6 месяцев назад
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.
@robakers6127
@robakers6127 Год назад
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 Год назад
This is sort of a late place to start. I would try to do the earlier lessons.
@BrianBeam-nl4lw
@BrianBeam-nl4lw Год назад
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
@ramonedrozojr.768
@ramonedrozojr.768 Год назад
same thing happend for me
@ramonedrozojr.768
@ramonedrozojr.768 Год назад
try to update your numpy
@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)
@andimulkrahimakbar9323
@andimulkrahimakbar9323 9 месяцев назад
Hi, face the same problem, did you solved it?
@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.
@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?
@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??
@emedosichijioke4557
@emedosichijioke4557 Год назад
Greetings from Nigeria, did you use Python programming language for the pi camera
@paulmcwhorter
@paulmcwhorter Год назад
yes
@RIPlly
@RIPlly 6 дней назад
I wonder, will this also work with raspi 5 and camera v3?
@paulmcwhorter
@paulmcwhorter 5 дней назад
The lessons will work with a pi 4. Lots of things changed on the pi 5
@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 Год назад
Here is an update to my homework for lesson 45, ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-FMmEJTisfFA.html
@paulmcwhorter
@paulmcwhorter Год назад
LEGEND!
@jameslewellen150
@jameslewellen150 Год назад
Here is link to my homework for this lesson, ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-5r9Raz-hIlM.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 Год назад
Another great learning exercise, Paul! Here is the link to my homework: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-iEcdQCwPulo.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.
@paulmcwhorter
@paulmcwhorter Год назад
LEGEND!
@hammadahmed3409
@hammadahmed3409 6 месяцев назад
Homework ru-vid.comH0ovfTPWvVM?si=eC-46tTcvTullI43 FPS is based on lighting
@paulmcwhorter
@paulmcwhorter 6 месяцев назад
LEGEND!
Далее
Редакция. News: 128-я неделя
57:38
Просмотров 762 тыс.
Наташа Кампуш. 3096 дней в плену.
00:58
Control ANY COMPUTER with these Pi KVMs!
17:46
Просмотров 809 тыс.
Raspberry Pi Camera Group Test
18:52
Просмотров 128 тыс.
Testing out the NEW Raspberry Pi Camera Module 3
9:40
Просмотров 304 тыс.
Tensorflow Lite with Object Detection on Raspberry Pi!
11:31
Hacking a weird TV censoring device
20:59
Просмотров 3 млн
Raspberry Pi Autofocus Camera & libcamera
42:11
Просмотров 41 тыс.
Samsung laughing on iPhone #techbyakram
0:12
Просмотров 6 млн