MF-DOF: Manual Focus DOF bracketing/stacking script

  • 5 Replies
  • 3632 Views
*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
MF-DOF: Manual Focus DOF bracketing/stacking script
« on: 10 / January / 2011, 17:20:58 »
Advertisements
« Last Edit: 19 / April / 2011, 17:50:51 by SkyWalker9 »

Re: MF-DOF: Manual Focus DOF bracketing/stacking script
« Reply #1 on: 13 / January / 2011, 04:28:01 »
Thanks for the script !

I don't know if you have seen the SDM auto-stack feature ?

You focus on near point and then start script.

It captures images with an increasing step-size until infinity focus is reached.

Focus position is displayed, values may be logged to a file and there is audible indication of infinity focus.

Here is a log file that I have just created :-

Auto focus bracketing                             

Continuous shooting mode                         

Time                       13:16:12

Focal length        10.8
Aperture             3.1

Focused distances (from front of lens) 
and step size                           

   264         0
   287        23
   314        27
   348        34
   390        42
   444        54
   516        72
   617       101
   768       151
  1018       250
  1514       496
  2964      1450
 11582      8618

Fixed step size only really applies for the closest focus settings.

Anyway, you may have some comments on it.
You can also create Tv-bracketed HDR focus-stacks and even time-lapse HDR-bracketed focus stacks.

For essentially macro subjects, your method of marking the near and far points would decrease the number of photos taken so is worth looking at.

David
« Last Edit: 13 / January / 2011, 07:18:45 by Microfunguy »

Re: MF-DOF: Manual Focus DOF bracketing/stacking script
« Reply #2 on: 13 / January / 2011, 08:24:37 »
I have noticed that the "Focus" values change when zoomed in or out while the camera stays the same distance from the subject

Because lens-to-sensor distance changes.

*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: MF-DOF: Manual Focus DOF bracketing/stacking script
« Reply #3 on: 13 / January / 2011, 11:40:04 »
I have noticed that the "Focus" values change when zoomed in or out while the camera stays the same distance from the subject
Because lens-to-sensor distance changes.
I was wondering about this...figured someone would have the answer. I'm always interested in learning about these things.  During experimenting with this script I've been testing different camera setups (M, Av, Tv, varying the physical distance to subject, etc.) and have been collecting notes on what worked best for certain situations. I also decided to start testing other apps to check the "Subject distance" measurements (other than just ExifPro) to see if there are any noticeable differences on what they report.

I still have a lot more experimenting to do with this script as well as looking at the SDM scripts. I routinely "tweak" the scripts (submitted from the forum) to customize them for my shooting style, etc., and I've got to do more LUA scripting and not concentrate on UBasic scripts quite as much. Always want to improve...

One of the best things about this forum is the ability to share information like this so that we can share our experiences with others and ask for their feedback -- I love it! I didn't really look into the SDM scripting because I don't use SDM, but now I realize I omitted a value source of information for improvement ideas! Thanks for your insights on the SDM scripts - I'll also be looking at the SDM scripts for more ideas now!


Re: MF-DOF: Manual Focus DOF bracketing/stacking script
« Reply #4 on: 13 / January / 2011, 12:43:40 »
Thanks for your insights

and thanks for yours.
Because of that, I am now testing a new uBasic command 'set_focus_range'.

When that command runs, it waits for you to press the left or right key to change focus, even if the camera does not have manual focusing mode.

(my A620, and various other cameras, HAS to be in manual focusing mode though).

Press SET to save nearpoint and repeat for farpoint.
Command then finishes and the values are made available to the focus-stacking command.

(Incidentally, the SDM auto focus-stack is a built-in bracketing feature, it is not a script).
« Last Edit: 13 / January / 2011, 12:47:32 by Microfunguy »

*

Offline SkyWalker9

  • ****
  • 301
  • SX20 IS (fw 1.02b)
Re: MF-DOF: Manual Focus DOF bracketing/stacking script
« Reply #5 on: 13 / January / 2011, 15:44:49 »
...press the left or right key to change focus, even if the camera does not have manual focusing mode...
...Incidentally, the SDM auto focus-stack is a built-in bracketing feature, it is not a script).
Whether the "auto focus-stack " is a script or a feature isn't quite as important to me as it is another source of ideas that could lead me to try making a script to do similar thing(s) - great to have other sources for ideas. For example, when I was considering whether to fabricate a remote shutter release myself or just try a commercial version (Ricoh CA-1 cable switch) with the SX20 CHDK one of the sources I used was the SDM documentation page that described the cable switch. The SDM web page info is what convinced me to try the switch (http://chdk.setepontos.com/index.php?topic=4348.msg59492#msg59492 ).

I like the idea of having the Left and Right buttons change the focal points as well, so I decided to update the MD-DOF script to allow users to use the Zoom-In/Zoom-Out keys or their Left or Right keys to adjust the near/far focus points.

Code: [Select]
rem Author SkyWalker9
@title MF-DOF
@param b Step size [x5]
@default b 8
@param c #Photos
@default c 2

if c<1 then let c=1
if b<1 then let b=1
b=b*5

sleep 500

print "Use Zoom IN/OUT"
print "or Left/Right buttons"
get_focus f
print "focus: ", f

a=f
z=f

sleep 1000
press "shoot_half"

:loop
   wait_click 10000
   is_key k "zoom_in"
   if k=1 then gosub "near_point"
   is_key k "zoom_out"
   if k=1 then gosub "far_point"
   is_key k "left"
   if k=1 then gosub "near_point"
   is_key k "right"
   if k=1 then gosub "far_point"
   is_key k "set"
   if k=1 then goto "Bracket_DOF"
   set_focus f
   print "focus: ", f
goto "loop"

:near_point
  f=f-b
  if f<0 then let f=1
  if a>f then let a=f
return

:far_point
  f=f+b
  if f>2000 then let f=2000
  if z<f then let z=f
return

:Bracket_DOF

  sleep 1000
  release "shoot_half"
  sleep 1000

  g=a
  if c>1 then let d=(z-a)/(c-1)

  for s=1 to c
    print "Shoot", s, "(", g, ")"
    set_focus g
    shoot
    g=g+d
  next s

  set_focus f

end

:end
end

Update 4-19-11: When using the wait_click statements, some cameras require the timeout be specified; recommend starting with "wait_click 10000" (10secs). The script has been updated to reflect the change.
« Last Edit: 19 / April / 2011, 17:51:32 by SkyWalker9 »

 

Related Topics