Use OpenCV and PiCamera2 with Raspberry BookWorm

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone in this video I'm going to show you how to display your camera with open CV and Pi camera too on your raspberry because as you may know the Legacy camera option does not exist anymore so for this demonstration I'm using a Raspberry Pi 4B running with the 64bits version of the bookor OS so I have already created my script but I'm going to explain playing it so I can enter my script with noo cam. and first of all I import CV2 and from P camera 2 import P camera 2 then I create my object camera py cam 2 which is equal to by camera 2 then I configure the camera so the first is the size of the camera so I chose uh 1920 and 1080 and then I choose the format in RGB 888 so the the eights are for the number of bits so eight bits for each color and this line is mandatory otherwise open CB will think it's an BGR and not RGB then I I can start the camera now let's display the camera and how are we going to do that every time we will take a capture of what the camera sees and we will display it on the screen so while true IM is equal to pyam 2 do capture underscore array so we can get the array of the camera because as you may know open CV works with the arrays so we can do a CV2 te show of the image so we name the window preview and this line will display the image then if we click on the letter Q we break the Y Loop we stop the camera and we destroy all windows let's try it so if I run the script you can see me no if I put in comment the line with the RGB configuration and I run the script you can see it's not RGB but in BG so that's why this line is super important all right so now you know how to use open CV and P camera 2 together
Info
Channel: Engineering_life
Views: 1,918
Rating: undefined out of 5
Keywords:
Id: CXa3UiTh4NQ
Channel Id: undefined
Length: 3min 23sec (203 seconds)
Published: Fri Apr 12 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.