Computer controlled focus, API?
/forum/topic/803284/0

end

floris
Registered: May 11, 2006
Total Posts: 4674
Country: United States

I was wondering if anyone knew whether it was possible to control the focus of an AF lens on one of the modern cameras like the 5D2. And, if so, is there an API such that I can control the focus from a programming language like C/python? Any help would be much appreciated, thanks!

By control the focus I mean, I want to tell the lens what distance to focus at, or to literally just control the USM motors, whatever to that effect is possible.



nathanlake
Registered: May 23, 2005
Total Posts: 6714
Country: United States

I don't know for sure, but Canon is not exactly third-party friendly. I really doubt they would publically document how to control their cameras/lenses.



kewlcanon
Registered: Mar 28, 2009
Total Posts: 3162
Country: United States

Maybe checkout this site:

http://magiclantern.wikia.com/wiki/Magic_Lantern_Firmware_Wiki

They've been tinkering with 5D2.



stanj
Registered: Aug 05, 2003
Total Posts: 8491
Country: United States

Yes, this can be done. You need to register as a developer with Canon and you can get a Mac/PC SDK. It's pretty poorly architected but it works. I use it for night exposure control and a buddy at work uses it for focus control (helican focus or whatever) to get more DOF for macro. You write code in C / ObjC on the Mac side - I don't know / care for PC



floris
Registered: May 11, 2006
Total Posts: 4674
Country: United States

Awesome, thanks guys!



BrianO
Registered: Aug 21, 2008
Total Posts: 6660
Country: United States

kewlcanon already mentioned Magic Lantern, but I thought you might find this link particularly useful:

http://magiclantern.wikia.com/wiki/Focus



end