How To Use The Raspberry Pi Camera
How to Configure a Raspberry Pi High Quality Camera
How to Configure a Raspberry Pi High Quality Camera. How to use the photographic camera with Raspistill and tape video using Raspivid. The Raspberry Pi HQ Camera has some pretty impressive specs for the price. It's a 12MP camera with a decent sensor. It comes with a ribbon, and a sensor cap out of the box. It's available by default in Raspberry Pi Bone/Buster. Its usage is elementary: Raspstill. It'due south an easy way to test this camera is by using the V3L2 Exam Bench.
@ jeremymorgan
jeremymorganTech blogger, writer, overall geek. Love tech and honey writing almost information technology.
I picked up the new Raspberry Pi High Quality camera last calendar week. It'south pretty impressive. In this commodity, I'll show you some ways to interact with this photographic camera and do some absurd stuff with it.
This is my current setup for this commodity. I congenital footling phase with Mario, and I have the camera with a lens, into my Pi, and a temp/humidity sensor hooked to it. It'south the aforementioned I used in my previous live stream with this camera.
In this commodity, we'll learn:
- How to fix up Raspberry Pi High Quality Camera
- How to configure the camera with V4L2
- Take pictures with Raspistill
- Record video with Raspivid
About the Raspberry Pi HQ Camera
So this photographic camera has some pretty impressive specs for the toll.
- Sony IMX477R stacked, back-illuminated sensor, 12.3 megapixels, vii.9 mm
- sensor - diagonal, 1.55 μm × 1.55 μm pixel size
- Output: RAW12/10/8, COMP8
- Dorsum focus: Adjustable (12.5 mm–22.4 mm)
- Lens standards: C-mount, CS-mount (C-CS adapter included)
- IR cut filter: Integrated
- Ribbon cable length: 200 mm
- Tripod mount: ane/4"- twenty
It's a 12MP camera with a decent sensor. Far ameliorate than previous Raspberry Pi Cameras.
It comes with a ribbon, and a sensor cap out of the box. However you will need to provide a lens for it (C or CS Mount.)
Yous can become your own HQ Camera hither. I chose this 35mm lens for the camera, it's not as well shabby and but 33 dollars. I also had an erstwhile cell phone tripod lying around so I mounted the camera to it.
Assembly is pretty straightforward. So enough most the camera, permit's look at how to use it.
Configure the Camera
Kickoff, you'll need to open upwardly your Raspberry Pi Configuration:
In the configuration, enable "Photographic camera":
And reboot your Pi.
Dialing in the Photographic camera
If yous want to know correct abroad the camera is working, get qv4l2.
This is the V3L2 Test Demote. It volition help you get your camera into focus, and you can modify various settings.
sudo apt-get install qv4l2 Subsequently installing it you'll demand to load this into your kernel:
sudo modprobe bcm2835-qv4l2 Then run the plan:
This application will give you a realtime view of your camera:
This will assist you focus the lens and adjust your lighting, contrast, etc.
Pro tip:
You can adjust the base of operations focal length of the lens with the camera. You tin adjust back and along depending on what field of study you're focusing on then gear up it with a prepare screw. This will make information technology easier to become the camera focused in.
With this, I just used a laptop to view the alive preview, so I could make adjustments and fine-tune the lens focus.
Once yous dial information technology in, you lot can starting time taking some pictures!
Capture Images with Raspistill
The easiest way to test this camera is past using Raspistill. It's available by default in Raspberry Pi OS/Buster. Its usage is unproblematic:
This volition output a loftier res epitome like this i:
Which is exactly what we were looking at with the V4L2 capture.
Hither are just a few things we tin exercise with Raspistill:
- Modify the size and quality of the paradigm
- Set exposure/ISO other settings
- RAW manner output
Type in "raspistill" by itself to see the options.
Permit'south try to add the date and time to our image. We'll prepare it to a 1024 x 768 image while nosotros're at it:
raspistill -northward -t one thousand -w 1024 -h 768 -a 1036 -ae +25+25 -o test2.jpg
So i thing that Raspistill doesn't allow is gratis form annotation or adding any text I want to the paradigm.
With Raspistill, you lot can take still pictures with the photographic camera, and they look great. There are many things you lot could do with this, including:
Security camera - Take one picture show a minute, and rotate out after a couple of hours
Webcam - have pictures every minute and upload it to a web page, similar the former webcams of the 90s
Motion detection - yous could set up a move detector and have it take pictures and store them when motion is present.
There are many cool things yous could practise with Raspistill.
Let's look at video!
Record Video with Raspivid
Raspivid is some other cool application for interacting with the Raspberry Pi Camera Module. It's a similar interface as Raspistill, and information technology'southward pretty easy to use. Here's how you tin record ten seconds of video:
raspivid -t 10000 -o test.h264
You can practise lots with this plan as well, including changing bitrate, levels, and simply about annihilation you can think of.
Here'due south an example of the resolution far away, if you wanted to use this as a security camera:
You lot tin can fifty-fifty tape out in something like MP4. From the Raspberry Pi documentation:
You tin can install MP4 box:
Then
# Capture 30 seconds of raw video at 640x480 and 150kB/due south bit rate into a pivideo.h264 file: raspivid -t 30000 -w 640 -h 480 -fps 25 -b 1200000 -p 0,0,640,480 -o pivideo.h264 # Wrap the raw video with an MP4 container: MP4Box -add pivideo.h264 pivideo.mp4 # Remove the source raw file, leaving the remaining pivideo.mp4 file to play rm pivideo.h264 This produces a nice trivial MP4 file:
It'due south easy and unproblematic to convert.
Final Thoughts
At that place are many things you can exercise with this camera, and I programme to expand on information technology a lot more. My takeaways:
- I similar the interchangeable lenses
- First-class image/video quality for the toll
- Piece of cake to work with
So if y'all're thinking near picking one up, I'd highly recommend it. There are a ton of groovy projects you tin can do with this.
If you want to larn more:
- Take this form to acquire the Raspberry Pi
- Photographic camera Module Documentation
- Raspistill Documentation
- Raspivid documentation
If you build whatsoever cool projects with thisPermit me know! I'd love to hear nigh information technology!
Previously published at https://world wide web.jeremymorgan.com/tutorials/raspberry-pi/raspberry-pi-high-quality-camera-tutorial/
Tags
Related Stories
Source: https://hackernoon.com/polising-raspberry-pi-high-quality-camera-3z113u18
Posted by: mcavoybearld.blogspot.com

0 Response to "How To Use The Raspberry Pi Camera"
Post a Comment