Adafruit Memento a.k.a. PyCamera Photography Parameters
I would love to build upon Adafruit's work and make something cool with their Memento camera module at its core, but before I brainstorm ideas I need to know what's already on hand. After reviewing the hardware side of this system, I moved on to the software side. Looking at sample code I immediately saw mention of a "PyCamera". As far as I can tell, it's the same thing. Adafruit's Arduino sample code documentation use the two names interchangeably. Perhaps PyCamera was a development code name for the product that eventually launched as the Memento? Perhaps Adafruit was afraid Arduino fans would pass over a product named PyCamera thinking it implied CircuitPython exclusivity?
One angle Adafruit used to promote Memento is the programmatic control we have over our photography. Given this sales pitch, I wanted to check out this camera's capability in photography terms I'm familiar with. Between reading Adafruit source code and "OV5640 register datasheet" available on their downloads page, here is my understanding:
Aperture
I found nothing that I recognize as a counterpart to controlling camera aperture. Maybe I'll find something later, but for now I believe aperture is fixed and we can't play with our depth of field or other aperture controlled photography techniques.
Shutter Speed
There's no physical shutter in an OV5640, but "exposure" affects how much time the camera takes to read sensor values. The default setting is to use its built-in automatic exposure control (AEC) which varies image integration time based on an internal algorithm, but it is also possible to switch the camera over to manual exposure mode for deliberately over- or under-exposed pictures. To a limited degree, at least. Even manual control is limited to range of "normal" photography so no multi-hour exposures here. The register datasheet outlines range of values but I don't understand what they mean yet.
Sensitivity (ISO)
The conceptual counterpart for OV5640 is "gain", and there is again the default of automatic gain control (AGC) with the option to turn off AGC and write values to specific registers to control gain. The register datasheet discusses the range of values, but I don't understand what they mean yet.
White Balance
We can turn automatic white balance (AWB) on or off, but that's all I know from this document. What happens when AWB is turned off is out of scope. Adafruit library exposes set_camera_wb()
but then we're out of luck for the actual values passed into that API. "For advanced AWB settings, contact your local OmniVision FAE."
Focus
This was the most excitement part for me, because vast majority of camera modules available to electronics hobbyists have a fixed focus. The OV5640 on board the Memento has a voice coil motor (VCM) to move its optical path and adjust focus. One of the Adafruit demos performed focus-stacking so I know we have programmatic access, and the camera test app exposes the ability to perform auto-focus. I was looking forward to seeing an auto-focus algorithm in detail!
Unfortunately my hopes were dashed. Indeed we have programmatic access to move the lens within its range of positions, and indeed we have access to an auto-focus algorithm, but the two are separate things. The auto-focus algorithm is an opaque binary blob uploaded to the camera running on its built-in microcontroller. We do not get to see how it works.
On the upside, there are a few auto-focus modes we should be able to select and allow us to specify a region for focus. These controls were designed to support the "tap to focus" usage pattern common to touchscreen cell phone camera apps. So while we don't get to see the magic inside the box, we have some amount of control over what happens inside. On the downside, this capability is not exposed via Adafruit PyCamera CircuitPython library API so some modifications will be required before experimentation can commence. If I might be doing that, I should dig in to see what's under the hood.