Reputation: 169
I would like to send a command to focus the camera, then turn the auto focus feature off, then take photos. This is to avoid the time it takes to focus between each photo. Is this possible? I have a program fully written, but this is the last piece of the puzzle.
Upvotes: 3
Views: 2558
Reputation: 436
There is a more precise way to detect what is actually happening after the focus starts. First, you can tell if the focus succeeded and also you can tell when the focus finished, so you don't need to wait too long.
The operation is different in LiveView and in normal mode. I have tested it in LiveView, but the documentation states some difference in normal mode. Anyway, this is for LV:
Use the first command as you did:
MainCamera.SendCommand(CameraCommand.DoEvfAf, kEdsCameraCommand_EvfAf_ON);
then periodically check the kEdsPropID_FocusInfo
property to detect if some of the focus points are in focus.
The documentation is plain incorrect in this on my camera (5D Mark IV), because the returned focus points have a justFocus
value, which should be 0 or 1 according to the docs, but it isn't!
Instead, I found that justFocus
has at least these values:
My tactics is to scan through the returned focus points and search for successful or failed focus. If found, I will then stop the focusing process by calling:
MainCamera.SendCommand(CameraCommand.DoEvfAf, kEdsCameraCommand_EvfAf_OFF);
Upvotes: 3
Reputation: 169
Here is what I found.
focusing is a bit problematic with the Canon SDK. But for your case I think the simplest thing would be this:
MainCamera.SendCommand(CameraCommand.PressShutterButton,(int)ShutterButton.Completely);
//Wait for some time here and if the photo wasn't taken, call:
MainCamera.SendCommand(CameraCommand.PressShutterButton,(int)ShutterButton.Completely_NonAF);
//Then, in either case, call
MainCamera.SendCommand(CameraCommand.PressShutterButton,(int)ShutterButton.OFF);
Or if you are using the live view you have to do something like this:
MainCamera.SendCommand(CameraCommand.DoEvfAf, 1);
//Wait for some time here
MainCamera.SendCommand(CameraCommand.DoEvfAf, 0);
MainCamera.SendCommand(CameraCommand.PressShutterButton,(int)ShutterButton.Completely_NonAF);
MainCamera.SendCommand(CameraCommand.PressShutterButton,(int)ShutterButton.OFF);
Hope this helps someone, as I have looked long and hard for this.
Upvotes: 1