Raspberry Pi 5 - Ep04 - Raspberry Pi Camera Module 3 - Python/OpenCV/Qt5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi welcome back today I received the items that I've been waiting for this cable well I had this um raspberry camera for two weeks but when I was trying to plug that in I realize the cable doesn't fit and I didn't know we need a special cable for Raspberry Pi 5 because they come in a different format so today I'm going to plug that in and try to see if it works and the other item that I've been um waiting for is this power supply I've been waiting for this for a very long time um without this basically Raspberry Pi runs for like with any USB C charger I've been using iPad um charger but basically I get the low voltage warning so this is the official one um so if you look at this this of 5 volt 5.1 volt and 5 amp so hopefully I will be able to use use raspberry pi as its full potential so yeah I will try to plug those in and see if it works um so I will try to remove this cable pop this and hopefully will slide out yep and I'll try to plug this in shaky hands and push this plasticy bit so there nice and snug and basically need to put side put that into displays zor so I need to pop this one it's bit hard to reach this small area I wonder yep maybe something like this okay and this a s so the metal bits shaky hands really hard to push this pin in so seems like they're connected so I will try to plug that all in together and then see if it works okay Moment of Truth yes hopefully it doesn't blow up where is my mouse okay it doesn't seems to recognize the um camera so I will stop it and try to debug this so it turns out if you plug the cable the wrong way then it doesn't work so this is the correct way so the you should be able to see the black side and oops like this so I just made it the camera camera app running so um I will do the recording on the um using remote desktop now okay so we are now loged on and the first things first is now I'm not getting the low voltage warning because I'm using the proper um power supply so that's a good thing so the first thing to do now now is trying to check if the camera works so if we check the camera yep seems to be working which is good sign and at this point I thought everything's going to be easy and that was a little bit naive because when I tried my open to be python script uh so if I run it it does nothing so I did bit of debugging and it turns out basically open CV is not getting any frames from the video um so I tried several I could Googled and then try sever several options like uh trying to detect it automatically using different flags and it's long story short I couldn't find a way to make it load with um open CV it seems like it's a known issue some people um go around it by pping the video to like m in the system and then trying to read it as M or or like doing a little like using VC whatever to kind of broadcast it and then doing a lot of crazy stuff so I started Googling about how to fix it or how to make it work and the thing I found is called pip camera too um there's a python package called Pi camera but that doesn't work with um Raspberry Pi 5 64bit and also it doesn't work with the Raspberry Pi camera module 3 so this Pi camera 2 seems to be the only thing that seems to work or I could find that works but it had problem um that you cannot install that in um virtual environment or cond and there is a work around for virtual environment but not easy way for cond so I have to do lot of heck I mean this is the kind of known issue that I looked it up so basically um first I have to fix the um version to 3.11 I initially wanted to use 3.9 because of the other project but for now I cuz I really want to make this camera work and with the cond environment because the easy solution is install the pie camera to package to the global Python and the system um but then it's I really don't like installing um project um libraries to the rout because it's it's going to conflict and you I really want to use Python and like K environment so it first I changed the version of the Python of the cond envir environment to 3.11 and then install the pie camera basically Pi camera 2 uses those two libraries lip camera and what is that k++ or something like that so first install that to the um Global Python and then I I installed this py camera 2 to my cond environment and then I manually copied this packages to my cond environment um and also I had to update the lip STD C++ file because of the one that um comes with the cond doesn't have the old version um of some functions so basically I need a very specific version that comes from um the so I linked it and I ran it and then I could get the um camera image but the next problem that I faced was that when I run with open CB um CVM show it got stuck it totally get Frozen and then after several hours of um debugging I decide to not to use use um cbmo and then try to use um pi qt5 and when I install pqt 5 it turns out it has a issue with open CV for this specific um installation and then as a work curent I uninstall python open CB open CB Python and then I install the Headless version so no high goey and after all this work around I could um where is it this one get the camera working um in Python open CV function still works but for the de go window I'm using QT and show camera oh no camera test and this is open CV so I'm drawing the frame rates in open CV function the window is um QT window and then I'm grabbing frames from the pie camera module 3 so yeah finally it took quite a long time I thought it's going to be really straightforward but no I had to do all this work around um so I have it I created another file f um for pi camera um so yeah so it was a success and if I run the the YOLO V8 with the custom 320x 3 20 model also works so oh another airplane I'm a person yep so it works um so yeah unfortunately using the proper power supply didn't make the YOLO V8 faster I didn't see any um visible Improvement but um at least I'm not getting the low voltage warning and then CU like sometimes if I run too many things I had a trouble running stuff but hopefully I don't get that anymore um and also I can use pie camera and I can run that in Python grab the frame um in open um in Python using open CV function and then I'm also able to visualize it so I'm happy so that's my video today thank you
Info
Channel: Jung
Views: 19,155
Rating: undefined out of 5
Keywords:
Id: LPC4ftpdc-4
Channel Id: undefined
Length: 15min 40sec (940 seconds)
Published: Sat Dec 09 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.