Building an HDR Panoramic Camera Rig

Version 1.0 - October 14, 2014
by Andrew Hazelden

Overview

Panoramic Camera Rig 2

This project creates a DIY panoramic camera rig that is capable of capturing fully spherical high dynamic range panoramas. The project uses a modified Canon DSLR battery grip that is interfaced with a MikroElektronia Mikromedia development board. The firmware has been written in C-code using the mikroC Pro for PIC32 compiler, and VisualTFT.

I've included a few sample images in the "panoramas" folder that were created with this system.

Also, you can explore an immersive 360x180° Google Photosphere view of the panoramic images I've created with the camera rig here: https://plus.google.com/u/0/photos/105694670378845894137/albums/5858680179003344369

The neat thing with this project is you are free to build upon the GPL v3 open source firmware and use it in your own camera control projects. The code currently implements the shutter button, half-press focus button, exposure dial up, and exposure dial down buttons.

This hardware setup can be re-purposed for many other activities like making custom timelapses with precise shutter speed control, capturing highspeed photos with the addition of a strobe light, interfacing with MikroElektronika mikroBus Click sensors like motion or sound detection boards to trigger photos, or creating bullet-time camera rigs, etc... the possibilities are endless.

The Canon DSLR battery grip is modified by soldering 5 jumper wires. The wires connect to the rotary dial controls, and the shutter button mechanism. This body grip connection allows the Mikromedia board to externally control the camera. It is important to note that since the removable battery grip accessory is being modified, your original camera body remains in stock, original condition.

If this is your first time modifying a Canon Camera accessory I recommend you start with an affordable used Canon digital SLR camera like the Canon 10D which can be purchased used on eBay for about $100 USD, and a battery grip be purchased on eBay for about $50 USD.

Because this project involves you taking apart your own battery grip module, and soldering to a flex ribbon cable, a standard liability disclaimer applies to this DIY project. I recommend you take your time, keep your soldering iron tip clean and free of residue build up, and pay attention to your soldering iron's temperature settings!

This project was inspired based upon the following DOC-DIY blog post:
http://www.doc-diy.net/photo/battery_grip/

The DIY Panoramic Camera Rig

Here is the materials list I used when I built my HDRI Panoramic camera rig:

To help me keep track of the Peleng's lens cap it has a piece of velcro on it so I can stick it to the matching piece of velcro mounted on the vertical part of the nodal pan camera mount. This means the lens cap isn't lost "in the field" when there are lots of things to keep track of.

Panoramic Camera Rig 1

Panoramic Camera Rig 3

The Mikromedia based hdr_clicker.vtft firmware has a large red "Shoot HDR" button that makes it easy to trigger a bracketed photo set. The help button on the top right gives a quick reminder of the suggested camera defaults for creating a successful HDRI panorama.

Mikromedia Screenshot

This is a closeup on the Peleng circular fisheye lens on the rig. I typically use an F/16 or F/8 aperture when filming with the focus set to infinity for outdoor scenes.

Note: A fisheye lens is typically sharper and crisper when it is used with a higher F-stop value.

Peleng Fisheye Lens

I created a simple velcro and rubber band mount that makes it easy to attach/detach the Mikromedia board from the panorama head and makes it easy to attach the jumper wires without kinking them. I highly recommend using a set of color coded jumper wires for the battery grip to Mikromedia connections so it is quick and simple to hook up in the field.

Mikromedia Wiring View

Battery Grip Modification

For my battery grip modification, I routed the jumper wires through the spare battery compartment space and out through a carefully drilled hole in the battery door cover hatch.

When the camera is used for normal photography, I can tuck the jumper wires neatly out of the way into the spare battery slot compartment in the battery grip.

Canon 10D camera on the workbench Spare battery slot mod Re-assembling the battery grip Passing the jumper cables through the battery door hatch This is the disassembled battery grip with the wires The wires were routed into the spare battery grip compartment This is the shutter button mechanism that supports half and full pressing. This is the rotary dial before wires were attached The is the flex cable before the soldering process started. This is the flex cable after the soldering was completed. This is the battery grip front half with the shutter wires and rotary dial wires connected.

Software Development

The HDR Clicker GUI was created using VisualTFT and the firmware was written in mikroC Pro for PIC32.

Visual TFT Shutter Screen Visual TFT Help Screen

mikroC Code View

To work out the precise timing values for the HDR bracketing process I used a microphone to record the sound of the camera's shutter while taking photos in continuous mode with AEB Bracketing enabled. This audio recording was then analyzed in Adobe Audition to fine-tune the photo intervals and delays.

Adobe Audition Shutter Timing 1 This image shows the shutter timings of a series 5 sets of 9 photo bracketed images as picked up by a microphone. The duration for a 9 photo burst without the memory card write out time included is 3.2 seconds.

Adobe Audition Shutter Timing 1

This screenshot shows the shutter timing for the first image in a 9 photo burst of pictures. A single photo takes about 1/3 of a second on a Canon 10D camera without including the variability of different exposure times.

Since I used a manual Peleng lens the camera didn't need to pause and read the EF lens data between shots. If you are using an EF lens you can adjust the timing values to fine tune the burst photo modes.

After a series of HDRI images are captured with the "Shoot HDR" button the busy text "Disk I/O" is shown onscreen to let you know roughly how long it will take for the camera to write the images to the memory card. If you try and take photos "too early" before the camera's memory buffer is empty again (and the red LED light on the Canon camera's memory card hatch is off) you may not be able to sustain the write speeds for the next HDRI bracketing shot.

At the moment the HDR Clicker firmware has the 9 Stop HDR mode enabled. Other exposure bracketing ranges are possible by adjusting the source code.

The code folder has two VisualTFT projects:

hdr_clicker.vtft - This is the primary firmware for triggering the camera. By default, the firmware takes a bracketed set of 9 photos that cover the shutter speed range of 1/4000th to 1/15th second.

UpDown.vtft - This is a simple example that lets you play with the camera controls.

Note: The source code works by flipping the TRIS state on the pins to send signals to the battery grip module. This means you need to connect the Mikromedia board to the battery grip's jumper wires, power up the Mikromedia board, then finally turn on the Canon DSLR camera. If you turn on the Canon camera before the Mikromedia board the camera will start taking photos until the Mikromedia board boots and toggles the TRIS state on the PIC32 chip's TRISB port.

HDR_Clicker.vtft Help Screen

When you click the Help button on firmware the Mikromedia board will display the following essential setup information:

Setup Instructions
GND: Green Wire
RB0: Blue Wire - Dial Up
RB1: Purple Wire - Dial Down
RB2: Brown Wire - Shutter
RB3: Red Wire - Focus

Turn on MCU before camera
Erase Camera CF Card

Camera Settings
Drive: Continuous
White Balance: Sun
Quality: JPEG Large
ISO: 100
Review: Off
Focus: Infinity
Aperture: f/16 Locked
AEB: One Stop

What is an HDR Panorama

A regular JPEG image stores data in an "low dynamic range" 8-bit per channel format that represents the red, blue, and green color data using a 0-255 integer range. When an element in the image becomes pure white it's value is recorded as Red: 255, Green: 255, Blue 255. If an object is super bright like the sun, or a lightbulb its brightness value can't go any higher than the 255 value and the picture information is clipped off.

A high dynamic range format uses a floating point system to record color data and it is possible to record super bright and extremely dark color values. This allows the image to record bright highlights and reflections (that would be totally clipped off in an 8-bit per channel image) while still preserving the subtle information in the darkest shadow regions.

It is possible to construct a high dynamic range image by merging multiple low dynamic range images that are taken using an exposure bracketing process.

For the best results possible the images are typically captured with a 9 stop (outdoor scene) or 15 stop (dark indoor scene) bracketing range. For a 9 stop exposure bracketing range the photography process would start by capturing the super bright objects in the photo using a 1/4000th of a second exposure, and proceed down one photo at a time to a very slow shutter speed like 1/15th of a second to capture dark shadow details.

A 15 stop exposure bracketing range covers the 1/400th to 4" shutter speed range and can only be done with scenic elements that don't move like building interiors.

A program like Photoshop, Photomatix, or HDR shop is then used to combine these exposures into a single image that has all of the lighting details preserved.

HDR (High Dynamic Range) panoramas are useful for more applications than just capturing an immersive view of a location for virtual tours. In computer graphics an HDR panorama is used for a technique called IBL (Image Based Lighting) that can be used to extract detailed lighting information from a real world location. This image based lighting process creates an extremely photo-realistic rendering that illuminates a 3D model or character in a way that produces the same lighting, shadows, and reflections for the object that would happen if it was a real physical object placed in a real location.

A good site to read for information on image based lighting is by Paul Debevec:
http://pauldebevec.com/Probes/

Dealing with Lens Cropping on Digital SLR Cameras

When I use an 8mm Peleng circular fisheye lens on a Canon 10D camera there is a 1.59x (times) focal length multiplier in effect that causes the sensor to crop a bit of the circular fisheye image data off at the edges of the otherwise circular shaped fisheye frame as seen in the next image:

peleng-8mm-fisheye-image-on-a-canon-10D.JPG

This happens because the Peleng wide angle lens is optimized to work with a "35mm film" style full frame sensor area to capture the complete circular fisheye image. The digital sensor in the Canon 10D doesn't have a full-frame sensor.

This means the smaller 10D CMOS image sensor causes the image to become magnified because it is looking through the center area of the lens and can't see all the way out to the edges.

Creating a spherical panorama works best if each set of bracketed images have enough built-in overlap so the panorama stitching software is able to handle the control point generation process automatically. That usually means one needs to take the images with the camera oriented vertically (on edge) to help with the overlap issue in the sky region where it is hard to precisely place control points in panoramic stitching software.

I typically shoot HDR panoramas by rotating the tripod to 4 positions (0°, 90°, 180°, 270°) and shoot an upwards angle set of bracketed images, and then tilt the camera downwards and shoot another set of bracketed images using the same 4 positions at 0°, 90°, 180°, 270°.

This means when I am done I have a folder with 72 photos per HDR panorama which as a recap means 9 exposure bracketed photos per view position x 8 view positions( 4 slightly upward angled view positions, and 4 slightly downward angled view positions).

HDR Panorama Source Images

Once you have the images back on your desktop system it is possible to use the Hugin (free), PT GUI, or Kolor AutoPano Pro software to stitch the images into a completed panorama. Each tool has a specific workflow but they are all capable of eventually creating the a spherical panorama output.

If you are using a free program like Hugin to create your HDR panoramas you may find it easier to stitch a preliminary panorama using a set of the 8 view position images (that have been renamed for clarity) that have the best exposure of the set (typically 1/60th of a second). After you have the Hugin control points for the panorama you can then swap the sets of files out for each bracket level you want to stitch and hit the generate panorama button. These panoramic images can then be stacked in Photoshop / Photomatix / HDR Shop.

This image shows an extracted set of the 8 view position images that were shot at 1/60th of a second exposure:

This is a set of the 8 view position images that were shot at 1/60th of a second exposure.

After you have a finished "stitched" spherical 360x180° panoramic image you need to decide if you want to paint out the tripod from the bottom of the shot using the clone tool in a program like Photoshop.

There are Photoshop plugins like Flexify that make it easier to paint a ground patch (also called a nadir region), or you could use a Photoshop tool I've written called the Domemaster Photoshop Actions Pack to help with the task.

Exposure Table

This is a summary of the 9 stop shutter speed bracketing range that is used by the hdr_clicker.vtft firmware example:


Created by Andrew Hazelden. (c) copyright 2014.
Email: andrew@andrewhazelden.com
Blog: http://www.andrewhazelden.com