I recently ran across this Reddit post to a Chaos Collective website that demonstrated a simple little webapp that could replicate the refocusable images that Lytro can output for HTML5 browsers. It actually was pretty neat, but other than the fact that the subject of your image had to remain still for the duration of the refocusing process, there was still one other thing that was particularly bothersome for me: you had to touch your camera to manually adjust the focus, which could potentially shift the image slightly and ruin the experience. I knew there was some way to do this refocusing but have the camera do it for me, automatically and without me having to touch the lens, and there is - at least for some Canon DSLRs.
There is a great piece of custom firmware called MagicLantern (ML) that is available for some Canon DSLRs that can add a bunch of powerful features to a stock Canon DSLR - for free! These features include the ability to take more shots in an HDR, HDR video, focus trapping, and rack focusing. The rack focus feature in ML allows you to set the range of focus that you want and record a video where the camera can then automagically change the focus within the desired range while recording. With this feature, combined with the Chaos Collective webapp, you can setup your scene in your camera, pick the far focus point and the near focus point, then automatically record the video and provide it to the webapp to make a refocusable image without touching the camera's lens to perform the refocusing!
Here's a short summary of how it works (assuming you have MagicLantern already installed on your camera):
- Set up the camera on a tripod and frame the subject in your scene.
- Set the camera in video recording mode.
- Set the lens into manual focus and adjust the focus to the "near" focus point.
- Reset the lens into autofocus mode. DO NOT TOUCH THE SHUTTER BUTTON.
- Bring up MagicLantern and go to the Focus tab.
- Use the arrow buttons to highlight "Focus End Point" and press Set.
- You will now see a LiveView picture of the scene. Press the Left arrow button to change the focus to the "far" focus point and press Set.
- Now, highlight "Rack focus" and press Set. The camera will now automatically change the focus back to where you started.
- Click the Play button and the camera will automatically begin recording and adjusting the focus.
- Once finished, download the generated video to your computer & convert it to a web format (e.g. MP4 or WebM). This part is hard and requires a lot more detail than I want to get into here, but there are converters out there that can help with this.
- Now, visit the Chaos Collective website and use the webapp.
- Voilà! You're very own refocusable image!
I know it seems like a lot of work, but I went into a lot more detail on how to properly set up MagicLantern for this post and is actually pretty easy once you get used to MagicLantern and its controls. Converting videos is a whole other discussion that I don't think I can get into here. But with MagicLantern, there is a whole slew of things you can do! In fact, with Magic Lantern, you can use HDR video, rack focus, a bit of video post-processing and the Chaos Collective webapp and make refocusable HDR images! Pretty neat stuff if you ask me!