Continous focal stack - General Help and Assistance on using CHDK stable releases - CHDK Forum

Continous focal stack

  • 10 Replies
  • 5724 Views
Continous focal stack
« on: 29 / June / 2011, 06:17:19 »
Advertisements
I'm new to CHDK and was wondering whether CHDK supports image capture while the the focus is changing. For example, I would like to capture an image (or several images) while the focus is changed from near to infinity setting. I know that this leads to generally blurry image/s, but I intend use post processing to get a fully focused image.

Thanks

*

Offline hotvedt

  • ***
  • 106
  • A540/SX110IS/350D
Re: Continous focal stack
« Reply #1 on: 29 / June / 2011, 07:05:41 »

Re: Continous focal stack
« Reply #2 on: 29 / June / 2011, 07:33:29 »
Thanks for the quick reply. While DoF bracketing is useful, I am looking for something slightly different. Maybe I wasn't clear enough. I do not want to capture multiple images at *discrete* focus settings. I want to be able to capture just one image while the focus is smoothly changing from near end to the far end. Unsurprisingly, every pixel in this image will be blurred. I intend to then computationally deblur this image to get a fully focused image. This method has an advantage over focus bracketing as I only need to capture one image. Thanks.

*

Offline hotvedt

  • ***
  • 106
  • A540/SX110IS/350D
Re: Continous focal stack
« Reply #3 on: 29 / June / 2011, 08:27:13 »
Is this even possible to do in software? How?
Zoom while exposure has been done via script, so i suppose it may be possible control the focus too.


Re: Continous focal stack
« Reply #4 on: 29 / June / 2011, 09:56:02 »
Thanks again for the reply. That's very hopeful. Could somebody point me to the script that zooms or focuses during exposure and the camera it supports? I could only find bracketed zoom.

To answer your question: Yes; it is possible to deblur the image to a certain extent. I refer you to http://www.cs.columbia.edu/CAVE/projects/flexible_dof/


Re: Continous focal stack
« Reply #5 on: 29 / June / 2011, 10:36:17 »
If you really think this would work, simply move the subject on a motorised Z-axis platform during a time exposure.

It has the advantage of keeping subject distance constant.
« Last Edit: 29 / June / 2011, 11:12:22 by Microfunguy »

*

Offline whim

  • ******
  • 2046
  • A495/590/620/630 ixus70/115/220/230/300/870 S95
Re: Continous focal stack
« Reply #6 on: 29 / June / 2011, 11:54:08 »
Quote
Could somebody point me to the script that zooms or focuses during exposure and the camera it supports?

zooming during long exposures on SX100 IS

hth,

wim

*

Offline fudgey

  • *****
  • 1705
  • a570is
Re: Continous focal stack
« Reply #7 on: 29 / June / 2011, 18:01:28 »
Indeed, if focus control works for you in scripts (while not shooting a long exposure), you should be able to try the same commands during exposure. The likely result will be that it either works, or fails to change focus or crashes the camera. Different camera models may vary in success.

But you may not be able to get a smooth focus run this way because the focus override goes in steps (trying to change that is probably not easy at all although could be possible). But if the step size is small enough, maybe it'll work for you.


But now that you've suggested this, wouldn't we be able to achieve a slightly narrowed down depth of field (for long exposures) this way by sweeping focus in a range narrow enough to always include one length in the dof? Without any post processing, that is.


Re: Continous focal stack
« Reply #8 on: 29 / June / 2011, 19:37:27 »
Thanks for all the suggestion folks. I'm quite encouraged by the last couple of replies. I'm off to loan a few different cameras from my friends.

Quote
But you may not be able to get a smooth focus run this way because the focus override goes in steps

I'm not yet completely familiar with the capabilities of CHDK/scripts, but I was hoping to do something like
1) Set focus to near
2) Start exposure
3) Set focus to infinity
4) End exposure

If the overide is only possible in steps, then shouldn't I be able to something like
1) Set focus to near
2) Start exposure
3) Increment focus in steps upto infinity
4) End exposure

Anyway, I think I'll dig deep in to possibilities before posting anymore dumb questions. Thanks.

*

Offline philmoz

  • *****
  • 3450
    • Photos
Re: Continous focal stack
« Reply #9 on: 30 / June / 2011, 08:16:31 »
Thanks for all the suggestion folks. I'm quite encouraged by the last couple of replies. I'm off to loan a few different cameras from my friends.

Quote
But you may not be able to get a smooth focus run this way because the focus override goes in steps

I'm not yet completely familiar with the capabilities of CHDK/scripts, but I was hoping to do something like
1) Set focus to near
2) Start exposure
3) Set focus to infinity
4) End exposure

You can do this using the set_focus(N) command. The problem is that the focus motors are quite fast on most of the Canon compacts (they don't have to move the lens elements very far) so unless your exposure is short most of it will be at the infinity end. This also means every photo has to have the same shutter speed - set to the time it takes the camera to go from closest focus to infinity. You would need to measure this for each camera.

Quote
If the overide is only possible in steps, then shouldn't I be able to something like
1) Set focus to near
2) Start exposure
3) Increment focus in steps upto infinity
4) End exposure

Anyway, I think I'll dig deep in to possibilities before posting anymore dumb questions. Thanks.

This method should also work and will give you more control over the exposure time. The difficulty that fudgey was alluding to is that the focus mechanism in these cameras isn't continuous. There are discrete positions / steps for the focus motor corresponding to fixed focus distances. These aren't linear, there are more focus distance positions at the close end and very few at infinity. For example the G12 looks like the attached image - the horizontal axis is the requested focus distance sent to set_focus() and the vertical axis is the actual value set on the camera (retrieved using get_focus()).

Phil.

CHDK ports:
  sx30is (1.00c, 1.00h, 1.00l, 1.00n & 1.00p)
  g12 (1.00c, 1.00e, 1.00f & 1.00g)
  sx130is (1.01d & 1.01f)
  ixus310hs (1.00a & 1.01a)
  sx40hs (1.00d, 1.00g & 1.00i)
  g1x (1.00e, 1.00f & 1.00g)
  g5x (1.00c, 1.01a, 1.01b)
  g7x2 (1.01a, 1.01b, 1.10b)

 

Related Topics


SimplePortal 2.3.6 © 2008-2014, SimplePortal