In November 2018, Sony announced and launched a creative campaign challenge for the new Spresense camera. In January 2019, after the dust settled a bit, I received my camera. Since I saw nothing online that explores this product, the following is my experience and assessment with some simple tests. Your experience and use may vary.
UnboxingAs with the main board and the extension board, the camera comes in a card deck size box. Inside is pretty simple as it contains the camera board with pre-installed ribbon cable and a product sheet. Like most product sheets, they are less on any valuable instructions and more on precautions and indemnification. Considering a large 12” by 12” page with one side in Japanese, and the other in English there is value here; after all the Warning, Limited warranty, Precautions, Specifications, there is a small 1.5”x3” box with a QR code, and a web address; https://developer.sony.com/develop/spresense
Getting the Camera workingIf you have already been working with the Spresense, you are 90% there; the other 10% is the real work. Using the link above, navigate the documentation and get the guidance you need to install the camera and update libraries. All that said, when you get to the example program, it works perfectly.
Installing the CameraTo understand the product better and how to install, it will be a bit challenging to find instructions needed through the developer pages, however hopefully this will help direct you to this important information
From the menu select Development tools/Develop using Spresense SDK/Hardware Overview and see sections 3.3 & 3.4. Alternatively, through the following link:
Updating the libraryBecause I wanted to ensure I had the latest libraries, I went through the process of updating the library set to version 1.1.2. Doing so, it is imperative to remove the prior version as this can cause issues. This can be done after the library is added by navigating to the following link and deleting the older folder..
- Go to: C:\Users\{userName}\AppData\Local\Arduino15\packages\SPRESENSE\hardware\spresense
- Delete the old release folder...or...If you are like me and play around with release libraries, you may want to move this to different location to preserve and local library changes you made for porting forward to the current release.
Online, the Spresense releases are located at this address or can be updated using the Arduino IDE Board manager. at time of this publication, there is a 1.1.3 release, but the article uses 1.1.2
Running the example
In the Spresense library there is an example sketch, “camera.ino”, which can be easily used without modification, however the only requirements are ensuring the camera is installed, removing the protective film on the lens, and installing a formatted SD card to store captured images.
The example, by default will capture 100 images and store each as a jpg on the SD card. My recommendation is to drop the number down to 10 - 25.
- C:\Users\{userName}\AppData\Local\Arduino15\packages\SPRESENSE\hardware\spresense\1.1.2\libraries\Camera
Once compiled and uploaded on the Spresense, enter the IDE's monitoring mode and watch the messages. After the number of images are captured, unplug the Spresense from power and remove the SD card.
Review your pictures through a laptop, smart TV, or other device. If you are like me you will be impressed by a quick out of box working camera.
Processing & Pictureassessment
Without any adjustments, processing of the images is relatively slow (~1 fps) and is likely something that can be adjusted; yet I did not explore performance. The picture quality looked a little dark resulting in the second picture taken above; both above. Still too dark. So, by some comparison, I took a similar image from my Sony Xperia phone to get a more representative picture to benchmark.
With a little examination of documentation, and the libraries you can find a few more things you can try; some options have not all have been completed by Sony and perhaps a future release will update.
Effects
There are 16 effects/filters that can be applied to the images taken which add to the capability. The Camera library, defines and makes reference to these, but out of the box I was able to get 6 to work; scroll through the images below you will see a normal shot, then B&W, Sepia, and other effects. The other 10 effects may be limitations to the library, part the issue with how images are written to the SD card, or some other cause. It was not apparent on the any deeper inspection as to the cause.
Regardless, changing the effect is simply done by adding the following line of code before the image is taken. All 17 effects are listed in the Camera.h library header; including "No effect"
theCamera.setColorEffect(CAM_COLOR_FX_SEPIA); // Set the Sepia filter
CamImage img = theCamera.takePicture(); // Take the picture
Scenes
Exploring the library, there are 13 different Scene modes listed, unfortunately they are not functioning in 1.1.2 release. Scene modes are expected to help provide proper color balance under certain conditions. Perhaps, Sony will polish these off in a future release.
White Balance
Light has different wavelength depending on source and intensity, white balance is a way for correcting some of the negative effects of this when taking pictures under different lighting conditions.
The following pictures are a single scene with different White Balance corrections applied. Since the scene is indoors with some natural outdoor light, and incandescent light over the stove, you can see which might work best. In this case, comparing the actual scene and the returned images, "Incandescent", "Flash" and "Cloudy" return the best result, while color tones are off for modes "Fluorescent"(blue), "Daylight"(washed out), and "Shade"(Yellow).
Changing the White Balance is as easy as other functions; below is a single call to be made before the image is taken. There are 6 White Balance adjustments listed in the Camera.h library header
theCamera.setAutoWhiteBalanceMode(CAM_WHITE_BALANCE_DAYLIGHT); // Set WB to Daylight
CamImage img = theCamera.takePicture(); // Take the picture
ISO
With old film cameras, the ISO or ASA was referred to as film speed and represented a sensitivity of the film to light. This allowed some films to be better suited for brighter or darker conditions, being more or less grainy, or allowed for better stop-motion photography. Now, with digital cameras, ISO is generally considered a factor in adjusting light sensitivity.
The Camera library has 19 different sensitivity levels from ISO 25, to ISO 1600. Below is a run through a few of those to get an idea of how the ISO reacts to lighting conditions. In the example below, bright lights hits the foreground and casts shadows, while distant clouds loft by. As you view each notice how the depth of clouds is washed out at higher ISO and the increased graininess.
Changing the ISO is done by adding the following line of code before the image is taken. All 19 ISOs are listed in the Camera.h library header; including.
theCamera.setISOSensitivity(CAM_ISO_SENSITIVITY_400); // Set the ISO to 400
CamImage img = theCamera.takePicture(); // Take the picture
Size,Format, & Video
The Camera library has a few different formats and sizes that can be captured, along with a video mode. However, in the examples above and a simple review of the library, it is an easy incorporation to explore these features on your own. Below is a summary based on library references.
- Video mode: 5, 6, 7.5, 15, 30, 60, 120 fps
- Image Formats: RGB565, YUV422 packed, JPEG, Gray-scale
- Image Size: OVGA, VGA, HD, QuadVGA, Full HD, 5M, 3M
Issues (minor)
Ghost image on SD card?
Even though the Camera.ino program gave me little challenge, I did find that running the program again to capture new images seemed to create problems when files were deleted and images written onto the SD card; using the same file name; PICT###.JPG. The new image appeared to be appended to the previous image and when viewed, the previous image flashed on, then settled on the new image; like a "Ghost". UPDATE: 2/12 Issue shared with Sony Development team. The issue isolated as follows and more of an oddity in SDHCI.h library to be fixed, or how functions should be used to avoid issues.
- Platform: Windows 10
- Application used: Windows "Photos"
- Version: Spresense SDK 1.1.2 with updated bootloader Oct 2018
- When it occurs: After overwriting Camera images on the SD card, and taking new pictures using same name; more evident when changing the scene, and using a effect, WB mode, etc on second pass.
- Process Example: 1) Snap 5 pictures using Camera.ino application. 2) Delete saved images on SD card. 3) Change camera direction or items in front. 4) Apply one of the Options above; Effect, White Balance mode, etc..5) Snap 5 different pictures using Camera.ino application (Using the same file name PICT###.JPG. 6) On Windows 10 machine, display images off the SD card using the "Photos" app and scroll through. 7) “Ghost” image will be seen befor e the second image
- Once file is copied on or off the SD card, the Ghost image is gone
Mismatched versions:
The following errors appeared in the monitor, but I did not see a significant issue, and one line refers to gnss (GPS) capability. Something I will investigate further.
UPDATE: 2/12 The issue of "Mismatched version" is common, the text will disappear once the bootloader have been updated. The following is a link where this process can be found
Example error
cxd56_farapiinitialize: Mismatched version:loader(17076) != Self(17594)
cxd56_farapiinitialize: Please update loader andgnssfw firmwares!!
More information
For more information and details review the following links; Sony Developer will put you in touch with use and technical content regarding the Sony Spresense, and GitHub will put you in touch with development releases
Sony Developer
Hackster
Github
SummaryThe Sony Spresense camera is a very quick out of the box, and successful experience. There are some limitations in the library, that I wish were address by this time; however, this is a maturing process. I used the 1.1.2 SDK, and as of January 2019, there is a 1.1.3 release....
Issues aside, a very basic program, no view finder or controls there is not much to expect without you taking this further. Sony Development team will help to resolve tough stuff within libraries, but the configuration, and application is up to you.
So, now what's next?
Comments