Raspberry Pi imaging, in the form of the first and second generation camera units, generally gets the job done. But it hasn’t ever been spectacular, producing images roughly in-line with an older smartphone. This situation, however, has changed with the release of the Raspberry Pi High Quality Camera—Raspberry Pi’s third major offering in this space. Image quality-wise, this new camera is a huge advance, largely because it can now accommodate interchangeable lenses.
Raspberry Pi High Quality Camera Specs
According to Raspberry Pi's product page, here’s what to expect out of this new unit:
· Sony IMX477R stacked, back-illuminated sensor, 12.3 megapixels, 7.9 mm sensor diagonal, 1.55 μm × 1.55 μm pixel size
· Output: RAW12/10/8, COMP8
· Back 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: 1/4”-20
Looking out the window, and a bookshelf positioned at ~7ft (Pi HQ camera)
Raspberry Pi HQ Camera Lens: What Sets It Apart
The HQ camera improves on the V2’s 1MX219 CMOS sensor, which features an 8.08 MP resolution and a 4.6 mm diagonal physical size. The new model’s larger 7.9 mm sensor diagonal is a huge iteration for light collection, and higher MP numbers are always better. What really jumps out, however, is the HQ camera’s ability to use C- and CS-mount lenses.
In fact, I’d argue that this feature is the thing that makes this new camera so special. After all, a sharp, perfectly focused image is very much preferable to one that’s blurry but can be zoomed in a bit more. Two different lens types are spec’d for the camera—a 6mm wide angle CS-mount lens and a premium 16mm C-mount lens (the latter of which was tested for this article). You can also supply your own C- or CS-mount lens for the camera, and it’s possible to adapt other format lenses as well, discussed separately here.
The V2 camera, while not fixed focus per se, requires a special tool (that’s normally included) to set up, and actually adjusting it is inconvenient, at best. In contrast, the HQ's interchangeable lenses open up a world of possibilities. The 16mm lens tested features both a smooth focus and aperture adjustment. The back focus ring can also be screwed out to allow for extremely close macro shots.
The camera also features threads for a standard 1/4-20 tripod bolt, making it much easier to mount.
Macro shots: resistor at ~1.5 inches from lens, tape measure at ~10 inches (Pi HQ camera)
C vs CS Mount: Adapter
One point of possible confusion with this type of adapter is C versus CS lenses. Both use the same threaded attachment, but the focal distance between the lens flange and the sensor is 5mm shorter in the CS version (12.53mm vs 17.53). The Pi camera assembly has a CS mount, meaning it can accommodate CS lenses without an adapter. C lenses also fit, but need a spacer (included with the HQ camera) between the two to allow them to focus correctly.
Raspberry Pi Camera Setup
To help you get started, Raspberry Pi provides a nice camera guide, which you can either purchase as a hard copy or download from their website. I won’t duplicate what that says, but here are a few tips to help you along:
· The HQ camera comes with a dust cover, C-CS adapter, and a small screwdriver for locking down the back focus ring. Whether or not they’re immediately recognizable, keep them tucked away until needed.
· Add the 5mm C-CS adapter if using the 16mm camera or any other C-mount lens.
· For macro shooting, adjust the lens focus ring roughly to the middle. Lock it in place, and adjust the back focus until the view is suitable. Lock the back focus ring down with the tiny screwdriver, then unlock the on-lens focus ring to make minor adjustments.
· Light gathering is regulated by the aperture adjustment ring, which also affects depth-of-focus. Once set, you may need to slightly readjust the focus ring.
· The stock cable is 12 inches long and has limited flexibility. Other options are available, if needed..
· Depending on your cooling arrangement, you may need to thread the Pi camera through your housing first, hook it up, and then attach the housing.
· Printscreen doesn’t seem to work when doing a standard image preview. Instead, set up your shots on the command line. This can be slightly inconvenient if you want to, say, document things for a review article…
· WinSCP is an easy way to get files off of your Pi Camera setup, though it can be fairly slow.
Raspberry Pi Camera Commands
After hooking the camera up and enabling it in preferences, you’ll want to try it out via the command line. The main commands are: raspistill, raspivid, Time-lapse, and raspiyuv. Of these, raspistill is perhaps the most basic application, allowing you to take a single photo. Here are a few commands to get you started:
· raspistill — enter by itself to get a help menu
· raspistill -t 0 — turns the camera on in preview mode. -t signifies the time (in ms), with 0 meaning "stay on until stopped with Ctrl+c"
· raspistill -o xyz.jpg — -o signifies the output file, which will be stored in your home directory
· raspistill -o wxy.jpg -awb sun -t 1000 — adds -awb sun to specify auto white balance setting, and -t 1000 to show a preview for 1 second before snapping the picture.
As shown, commands can be combined for a seemingly infinite array of options. Consider that the real power of this device isn’t in typing in commands each time; it’s that such commands can be automated.
For example, perhaps you’d like to take specifically tuned Python script that runs once an hour via cron. Not a problem—just set up your scripts and let it go. Also, note that these commands should work with previous camera versions if you choose to go that route.
A Few Things That Could Be Improved
One thing that isn’t available “out of the box” is a way to set white balance numerically—e.g. 4500K or 2700K. While the available descriptive levels like sun, cloud, and shade will likely work in most cases, if you want to calibrate things specifically, this is not currently available. However, Raspberry Pi is working on an open source camera stack called "libcamera" that does offer this functionality. It’s still a work-in-progress, but you can experiment with it now with a bit of yak shaving.
Focus-wise, something that would be extremely cool is if the preview could feature your region of interest zoomed in during the preview. I wouldn’t actually expect this feature out of a ~$100 camera setup, but it would at least seem doable with only software.
Like the numerical light temperature option, a numerical focus display option also appears to be in the works. Between these and other features are underway, software support should get better as time goes on.
Finally, the camera can only shoot video up to a 1080p resolution, not 4K. It should, however, be possible to produce a 4K UHD time-lapse with its 4056 x 3040 stills shooting ability.
The Right Camera for You?
The Pi HQ camera stares down potential rivals (Pi HQ camera)
When considering this camera versus other options, consider your use case. Do you just want it for robotics applications where the beauty of the shot doesn’t really matter? Perhaps an older V2 camera would suffice, saving you weight, expense, and potentially adjustment hassle. If you just want beautiful images on-demand, you might think outside of the “Pi box,” as many smartphone cameras and point-and-shoot cameras do a great job. One might also consider a traditional webcam in some scenarios. Webcames provide much less control, but often focus automatically, and use a standard USB cable.
Where the HQ Camera Excels
As noted early in this article, this new camera setup is heads and tails above the previous iteration quality-wise, even if that comes with tradeoffs in size and cost. The niches that I really see this camera filling are in long-term time lapse applications and computer vision applications where the camera stays still and the subject or subjects move on a relatively well-defined plane.
One general constant in Raspberry Pi and maker-focused electronics is that great hardware will be used in amazing ways that its creators never envisioned. With improved vision capabilities, as well as the expansion of the Pi 4 line, we can expect even more amazing applications out of this ecosystem in the future.
*Note that Pi camera shots for this article were all taken with 16mm lens, and not otherwise enhanced.