ArduCam just sent me this, a new camera module for the Raspberry Pi with built-in autofocus.
With other Pi cameras, you sometimes have to manually focus before taking a picture
or video, and that gets old—fast. With this camera, it'll autofocus for you, whether you
have something close up, or something far away.
This is big... well, actually, it's kinda small. But it's big news because up until
now, most of the autofocus solutions for Pi cameras involved building complicated motorized
mounts like this one for the HQ camera.
For years, smartphones have had autofocus on their tiny cameras, and it looks like ArduCam
finally cracked that nut for the embedded community. Hardware-wise, this little camera
packs in a 16 megapixel Sony IMX519 image sensor, the same one used on the OnePlus 6
smartphone.
Quality-wise, it's a good step up from the Pi Camera V2 that's the same price and size,
and a little worse than the HQ Camera Module—though I should remind you that camera costs twice
as much and requires an additional C-mount lens.
The fixed 4.28mm lens is like a 25mm wide-angle on a full-frame camera, and that's pretty
close to the Pi Camera V2's viewing angle. Of course, on the HQ camera, you can put on
different lenses, so the aperture and viewing angle aren't fixed, but those lenses do add
cost and bulk.
You can swap out a Pi Camera for an ArduCam in most existing cases, but the little extra
bulk on the front for autofocus on the front might get in the way for a few enclosures.
It includes its own protective case, though, with a built-in tripod mount on the back.
That's a weird mounting point, and the screw hole's also a little shallow, so it might
not work with every tripod, but it is nice they included a case.
Video capabilities between the Pi cameras and the ArduCam are similar, with all cameras
offering 1080p at 30 frames per second, and 720p at 60. I haven't done any testing on
how high a framerate you can get at lower resolutions, but according to one poster on
Hacker News, the camera's capable of 120 frames per second at 480p.
But the built-in autofocus is what really sets apart the ArduCam. And it works—a lot
better than I thought it would! I was expecting a focus hunting nightmare, like what I remember
with old SLRs. But instead, the Pi seemed to snap into focus pretty quick, with minimal
hunting—at least in well-lit environments.
For video, too, you can set the camera to autofocus at the beginning of the video, and
it does that just as fast.
But one thing that's not available yet is full-time automatic autofocus.
Right now autofocus is a one-time thing, at least in terms of practical use: you fire
off a picture or start recording, and it'll autofocus once, at the beginning.
ArduCam provides a Python script to adjust focus on the camera, but that's mostly a tech
demo right now. It isn't completely integrated with Video4Linux yet.
You can at least refocus while recording a video or taking a still using the Terminal,
but it's a little clunky.
It's definitely not the same experience you get plugging in something like a USB webcam,
that just starts focusing automatically on its own. BUT, the hardware is there—it's
the software side that's lacking. Hopefully it's only a matter of time until libcamera
and Video4Linux work with the ArduCam out of the box.
But even with the piecemeal beta software available before the camera's even for sale,
this camera's a breath of fresh air if you use the Pi Camera in a lot of different situations.
Just the fact that I don't have to carry around one of these silly refocusing tools to switch
from up-close to distant subjects with the Pi V2 camera makes it worth it for me. And
a price of 25 bucks would a bargain compared to the v2 Pi Camera, as long as image quality
is on par or better.
For a good test shot, I set up all three current generation cameras: the Pi Camera V2, the
HQ camera, and the ArduCam, and I aimed them at my Raspberry Pi mug and a few other objects.
I shot from the same angle, with the exact same lighting conditions, and only tweaked
the shutter speed slightly to account for the aperture differences.
And you can see that the colors on the HQ camera are much more vibrant and closer to
reality than the other two—the larger sensor area gives each pixel more color data, so
it can really absorb those vibrant reds and greens.
The Arducam seems to be closer to the colors from the Pi Camera v2, though it doesn't have
the same artifacting on the edges. And looking at a closeup, you can see a lot more fine
detail that's just lost with the 8 megapixel v2 camera. And the extra resolution even helps
the ArduCam edge out the HQ Camera slightly, if you just need clarity.
Speaking of clarity, both Raspberry Pi cameras also seem to oversharpen things—notice the
edges of the white Raspberry on the mug. The real mug blends from white to red, like the
ArduCam shows. The HQ Camera and Pi Camera V2 both have a little bit of fringing that
can make pictures feel a little 'muddy'.
For the HQ camera, that can be fixed to some extent with a more expensive lens—in these
tests I was using the recommended, but okay-quality Wide Angle lens. In terms of colors, the HQ
camera is the clear winner. But in terms of overall sharpness and quality, the ArduCam
wins for me.
The video quality isn't bad. It's not incredible, and you're still gonna bump into limitations
with the Pi Hardware more than the camera, but the main difference between this camera
and the HQ Camera is a little less dynamic range.
I had to reduce the exposure gain a tiny bit so my face wasn't washed out, but doing that
also makes the dark shirt I'm wearing turn practically black.
And using autofocus in video is a little weird; on the Pi, I have to manually press 'F', then
'Enter', and it'll refocus. Hopefully the software side will improve to make using the
ArduCam for things like a webcam easier.
Now that I've had some time to test it, I also wanna highlight some problems. First,
because it's so new, tools like Video4Linux don't work with the camera out of the box
the same way as with other cameras. I had to specify a subdevice to be able to control
the focus_absolute property if I wanted to set focus manually.
And until their work is merged upstream into libcamera, you have to uninstall Raspberry
Pi's built-in version and install a fork of it from ArduCam.
Worse still, the early dev release I'm using doesn't work with Pi Cameras, so it's an either-or
thing. I had to use two different Pi OS installs to test all these cameras: one for the Pi
cameras, and another for ArduCam.
For camera quality, I was mostly happy, though it's not a match for the bigger sensor in
the HQ camera. And if you're looking for flexibility, the HQ camera's C-mount lets you mount different
lenses.
And the key feature, autofocus, might not be as good as you're used to, even on something
like a cheap mirrorless camera. If you want face or eye AF, or any control over the focus
area, that's just not a thing on this camera—at least not yet. Autofocus uses a small center
focus area, and that's it. So if you wanna focus on something outside the center of the
frame, you'll have to focus manually.
Software updates might make things easier in the future, especially once it's more integrated
into Video4Linux and libcamera. But for now, don't expect the moon.
I also checked and right now, since the camera's so new, I couldn't get it to work with showmewebcam
or my own uvc-gadget script, so I can't use it as a USB webcam yet.
So would I recommend the camera? Well, if you don't need the quality or versatility
of the High Quality Camera, then for almost anything else, the new 16 megapixel ArduCam
is better than the Pi Camera v2, at least in terms of features and image quality.
As things stand right now, it's not a proper replacement in every case because of the software
support, but once that's sorted, there aren't many times I'd prefer a camera that doesn't
have autofocus.
And at 25 bucks, even if you're on the fence, the price makes it almost an impulse buy.
If you're like me and you already have a box or drawer full of Pi cameras, cables, and
hopes and dreams, why not toss in another on? Maybe you'll finally work on that cool
Pi vision project you've been putting off.
Who am I kidding? You and I both know that's not gonna happen. Until next time, I'm Jeff
Geerling.
If you're still watching this, you're one of the few who don't drop off when I start
my whole 'until next time' schpeel.
I just wanted to say thanks for watching, and thanks especially to all the people who
scroll by on the left side of the screen at the end of my videos. It's incredible, being
able to work on these videos, my open source projects, and my books, and it wouldn't be
possible without your support. If you're able, please consider sponsoring my work on Patreon
or GitHub sponsors: there are links in the description below!