Automated Focus Stacking. Is this feasible?

Started by webrob123, January 20, 2015, 05:58:41 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

webrob123

I am developing an automated turntable to generate 3d models using photogrammetric techniques. It is cloud connected to take advantage of processing power available in the cloud for faster model generation. I already have an early version of the hardware working. It's based on a Rasberry Pi computer running Linux to control the turntable and it also uses ghoto2 to control a Canon 60D - this automates triggering capture via USB and then transfer of the image over USB to the Raspberry Pi for further processing and upload to the cloud (currently EC2 instances).

For some small subjects depth of field is an issue. Photogrammetry works much better if all parts of an image are in sharp focus. So I'd like to use ML to do focus stacking but I'd like it to work in an automated fashion within my current setup. Currently I can set the number of photos I want to take per 360 degree revolution of the turntable using a command line program that interacts with my python based app. I press start and the system just snaps away until a full rotation is complete (i.e. one photo for each step in the 360 degree revolution - e.g. 15 steps or one photo for every 15 degrees).

What I'd like to do is bring ML's stacking in to the equation. So for example each 15 degree steps I'd take 10 photos instead of one and then focus stack. Ideally I'd like to do the focus stacking on the Raspberry Pi at some point (or another more powerful Pi clone), but at this stage I'm more keen to just automated the focus stacking image capture part of the equation (i.e. taking the ten shots per degree and transferring those images via gphoto2 to the Raspberry Pi over USB).

I'm new to ML and so I thought I'd post here to see if anyone can confirm that ML focus stacking could be used in an automated fashion? I've played about with manually doing one focus stack whilst operating the camera by hand, but if someone could confirm that there is a way for me to script focus stacking on ML and hook in to controlling ML via the Raspberry Pi and my python code that would be great!

Any help or pointers would be really appreciated.

dmilligan

You can send/recieve custom PTP commands from ML, but I think gphoto2 can control focus itself (only in LV, same as ML). So I don't really see why you'd need ML at all.

http://www.gphoto.org/doc/remote/

--set-config manualfocusdrive=[mode]

Where mode is "Near 1" "Near 2" "Near 3" "Far 1" "Far 2" "Far 3". These are 3 different relative stepsizes for both focusing directions. To achieve focusing, multiple calls might need to be done.