Search My Blog

Tuesday, August 6, 2013

HDR photography with Raspberry Pi and gPhoto2 | Island in the Net

Here's a Great Project. Using a Raspberry Pi to control a Nikon Camera, via USB and capture bracketed images...



HDR photography with Raspberry Pi and gPhoto2

This entry was posted in How To and tagged , , , on by .

UPDATE: See my new blog post where I rewrote the code in Perl and added a trigger for the Pi.

I bought my Nikon D40 in 2006. The D40 is my first and only DSLR camera and I’ve loved using it every day that I’ve had it. At the time, it was Nikon’s entry-level DSLR and it suited my budget and photography skills. Over the last 6 years that I’ve owned the device my photography skills have improved but not my budget1. I’d had to make do with the limitations of the D40 — 6 megapixel DX sensor, 200-3200 ISO range, no auto-bracketing — but the lack of auto-bracketing has been the most limiting.

I love making high dynamic range (HDR)2 photographs. I love how my photographs come alive with the expanded range offered by HDR. HDR photography involves taking multiple photographs at varying exposure levels and combining the photos into a single final image. HDR photography requires a good tripod and a camera that can shoot bracketed photos. Having a camera body with auto-bracketing makes this easy. On the D40 I can manually adjust the exposure values (EV) between each capture but I risk moving the camera. A slight movement can make aligning the images much harder.

I’ve researched various solutions for my problem. I used a Mac app, Sofortbild, to tether my D40 to my MacBook via USB. Sofortbild provides complete remote control of a Nikon DSLR camera — like shutter speed, aperture, exposure, white balance, iso, image format — and automatically transfers captures images to the Mac hard drive. It can also auto import images into iPhoto, Aperture or Adobe Lightroom. However I was interested in it’s use for HDR photography.

Perform bracketing with an arbitrary number of different exposure values by defining minimum and maximum shutter speed and step. After bracketing high dynamic range images can automatically be calculated including auto image alignment and saved in all major high dynamic range image file formats. Filenames will get same index including incrementing suffix for easier workflows with external high dynamic range applications.

Sofortbild is easy to use and fully functional but … the setup wasn’t only practical in a studio or controlled set. I just didn’t see myself lugging a laptop, tripod, camera and lenses around. With a MacBook Air, maybe. A 7 lb MacBook. No. I wanted something lighter.

I started researching options to control the brackets using my iPhone. Searching the web I found a project called The creator wrote an iPhone/iPad (iOS) app that could trigger an IR LED to send the correct binary sequence to trigger the IR on the Nikon. The creator sells a pre-built IR remote but I built one myself. However, he author of the app limited the fastest shutter speed to 3/10 second. This was too slow for my daylight HDR. Most of my test shots were completely blown out in the highlights.

When the Raspberry Pi single board computer was announced I could immediately see the usefulness of such a small. I ordered one and four months later I could starting working on my first project. I planned to used the Raspberry Pi to control my Nikon via USB and capture bracketed images.

After much research and trial and error I think I have a working solution.

Apple iPhone 4 (3.85mm, f/2.8, 1/120 sec, ISO80)
My D40 auto-bracketing kit.

What you’ll need


DSLR Cameras and Projects
DSLR performance measured with audio editing software
DSLR performance measured with audio editing software
Would you entrust your DSLR to this diy underwater enclosure? - Hack a Day
USB dongle hack tethers DSLR cameras at a fraction of the price - Hack a Day
DSLR performance measured with audio editing software - Hack a Day
Raspberry Pi wedded to a DSLR
Raspberry Pi wedded to a DSLR
Linux Made Easy: Remote Control your DSLR with Linux and Android
How To Hack Your Canon DSLR To Remove Annoying Limitations : Web Video University Blog
Camera Pi – DSLR Camera with Embedded Computer
Camera Pi – DSLR Camera with Embedded Computer
broadband » The 'bible' for Information on DSL, Cable and Other High Speed Internet Services : All reviews |, ISP Information
Speed Test : upload and download |, ISP Information
Speed Test -
Speed Test -
Magic Lantern announces free HDR video firmware for Canon DSLRs
Magic Lantern announces free HDR video firmware for Canon DSLRs
Helicon Remote - automated focus and exposure bracketing for Canon and Nikon DSLRs
Linux Today - Remote Control your DSLR with Linux and Android
Nikon D3000 25462 DSLR Digital Camera and 18-55MM VR Lens - 10.2 Megapixel, 3.0 TFT LCD, SD/SDHC Slot, USB, Black at

Raspberry Pi $25 to $35 PC
Raspberry Pi Foundation
YouTube - Raspberry Pi - the £15 computer
Questions remain over $25 Raspberry Pi -
The Raspberry Pi Computer Is Finally Being Manufactured ~ Web Upd8: Ubuntu / Linux blog
Raspberry Pi Lands eBay Bidding Up To $2,700 USD
$25 Linux PC 'Raspberry Pi' to Go in Production Early Next Year ~ Ubuntu Vibes
Build the 2006 prototype of Raspberry Pi's $25 PC – Computer Chips & Hardware Technology |
Simple 3d graphics on a microcontroller - YouTube
RaspBerry Pi on DonsDeals Blog - Google Custom Search
DonsDeals: XBMC running on Raspberry Pi
DonsDeals: Raspberry Pi's Gertboard expansion board already works (video) – Computer Chips & Hardware Technology |
Group: Raspberry Pi - element14
Arch Linux ARM available for download | Raspberry Pi
Register here to express an interest in Raspberry Pi
Raspberry Pi sells out within one hour | Linux User
Raspberry Pi gets Arch Linux | Linux User
FAQs | Raspberry Pi
Group: Raspberry Pi - element14
About us | Raspberry Pi
Farnell / Electronic Component Distributors / Suppliers / Electronics, Electrical Parts, Electrical Components and Wholesale Electronics.
RS Components | Electronic and Electrical Components
Export | Electronic Components | Electronic Parts
Register interest for your @Raspberry_Pi.
Raspberry Pi | A revolution in low cost computing. Brought to you by Orbits IT
Raspberry Pi - Wikipedia, the free encyclopedia
PCH Search & Win: Raspberry Pi
Don't bring this teacher an apple, he prefers Raspberry Pi |
Overview | Adafruit Raspberry Pi Educational Linux Distro | Adafruit Learning System
Occidentalis v0.2 | Adafruit Raspberry Pi Educational Linux Distro | Adafruit Learning System
DonsDeals: Raspberry Pi - Seneca Fedora Remix 14 Release
RPi Hub -
RPi VerifiedPeripherals -
So you got a Raspberry Pi: now what?
Raspberry Jamboree 2013: Amy Mather - Conway's Game Of Life - YouTube
The MagPi We produce a magazine with the intent to help and offer advice to users of the Raspberry Pi

No comments: