Friday, 23 January 2015

Setting up focus stacking

I am trying to convert a flatbed scanner as a moving support for my camera for focus stacking. I'm going to document how it goes in case it helps others.

The idea of focus stacking is as follows:


  • I would like to take very close-up photographs of a gametophyte fern. 
  • I have a 5x Canon macro lens, but at the 5x magnification it only has 0.1mm depth of field.
  • In focus stacking the subject is photographed many times, and moved toward the camera a little each time. The many photographs are then combined into one single sharp photograph using commercial software (I'm using Helicon Focus).
  • With such a small subject it will be easier to make the moves using an electronic platform. 
  • I am going to convert a flatbed scanner so that I can put the fern on the arm and move the arm in tiny steps using a computer programme. 
  • The computer programme will run on a Raspberry Pi computer, which will also trigger the camera to take shots between moves. 

None of this was my idea. I learned it from the following sources:


It was recommended to me by Jim Haseloff of the Department of Plant Sciences in Cambridge. 

My hope is to set up a system like this and use it to support my own interest in photographing gametophyte ferns. 

I am hoping to take photos like this one of my own, but much better:





So how am I actually going to get this done? 

I'm using a Plustek OpticPro U12 scanner as it is quite an old model so is very solidly built, with a big strong platform on the scanner arm. This is it with the cover and glass platform taken off:


The motor inside is a unipolar one (shown by the fact that it has 5 wires).


The arm motor controls some cogs which push the platform along a metal pole.


There are two boards in the scanner as shown below:

The motherboard has a ULN2003 chip on it which we could use to control the motor, but I am going to buy a different one that will be easier to program.




I am going to hitch the scanner up to a Raspberry Pi by the method descriped in O'Reilly's "Raspberry Pi Cookbook".  To do that I have ordered:

- some male to female jumper wire
- an electronics breadboard,
- a chip called ULN2803
- a copy of the book.

We already have a Raspberry Pi and the means to connect it to my laptop via the network in our house.

I am going to work out how to set up the scanner arm to move forward in the correctly tiny steps at the correct speed, and then install software on the pi to trigger the camera to take shots in between steps.

This is just the first chapter of quite a long project. Hopefully more progress next week. :-)

The next page of this story is on this blog page.