who can write a Focus shooting Script for Sx40 hs - Script Writing - CHDK Forum

who can write a Focus shooting Script for Sx40 hs

  • 7 Replies
  • 4652 Views
who can write a Focus shooting Script for Sx40 hs
« on: 14 / July / 2012, 03:40:23 »
Advertisements
who can write a Focus shooting Script for Sx40 hs  。

I'm chinese,my english very bad。

want have a Script for SX40 HS. Requirement:Continuous shooting two。the first,According to the focus of AF。Second,Forced focus at 2CM(maybe Macro) shooting.

use the two pics to make Bokeh in CHDK’s Script or  in PS

Re: who can write a Focus shooting Script for Sx40 hs
« Reply #1 on: 14 / July / 2012, 11:02:08 »
who can write a Focus shooting Script for Sx40 hs  。
 the two pics to make Bokeh in CHDK’s Script or  in PS

Here you go :

Code: [Select]
@title Bokeh
print "Bokeh"
  shoot
  set_focus 20
  sleep 500
  shoot
print "done"
end

You will have to combine the pictures on your computer - its not possible to do with a CHDK script.

Also,  your camera might need to be in "P" mode rather than "Auto".
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: who can write a Focus shooting Script for Sx40 hs
« Reply #2 on: 14 / July / 2012, 13:09:01 »
I'm afraid this does not work because the sx40 has a native MF mode. We must switch into the MF mode for set_focus. This only works with Lua.

Here is a sample script (not tested):

Code: [Select]
@title bokeh
@param f focus [mm]
@default f 20
]]

function switchAF_MF()
    post_levent_for_npt("PressSw1AndMF")
    sleep(500)
end

-- first shot
shoot()
Tv=get_tv96()
Av=get_av96()
repeat sleep(10) until get_shooting() ~= true

-- second shot
switchAF_MF()
set_tv96_direct(Tv)
set_av96_direct(Av)
set_focus(f)
shoot()
repeat sleep(10) until get_shooting() ~= true
switchAF_MF()

print("done")

Probably there is yet another problem with the minimum distance. See platform_camera.h for the SX40.
Code: [Select]
#define CAMERA_MIN_DIST                     95      // Override min subject distance
msl

edit: script corrected, thx ww.
« Last Edit: 14 / July / 2012, 13:37:55 by msl »
CHDK-DE:  CHDK-DE links

Re: who can write a Focus shooting Script for Sx40 hs
« Reply #3 on: 14 / July / 2012, 13:13:58 »
I'm afraid this does not work because the sx40 has a native MF mode. We must switch into the MF mode for set_focus. This only works with Lua.

That explains why the uBASIC script works on my SD940 and not my G10.   Was going to look at that later today - I'll try your version.

Update :  tested your script -works on my G10.   The line that says

Code: [Select]
set_av96_direct(Av96)
should be

Code: [Select]
set_av96_direct(Av)
« Last Edit: 14 / July / 2012, 13:29:22 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: who can write a Focus shooting Script for Sx40 hs
« Reply #4 on: 15 / July / 2012, 05:15:58 »
who can write a Focus shooting Script for Sx40 hs  。
 the two pics to make Bokeh in CHDK’s Script or  in PS

Here you go :

Code: [Select]
@title Bokeh
print "Bokeh"
  shoot
  set_focus 20
  sleep 500
  shoot
print "done"
end

You will have to combine the pictures on your computer - its not possible to do with a CHDK script.

Also,  your camera might need to be in "P" mode rather than "Auto".

i changed code :sleep500  =sleep 1    and,test this script、in AV  MF mode About 85mm and edit in PS,look photo(this script‘s Interval time Seems to be useless 1 or 500 )
« Last Edit: 15 / July / 2012, 05:32:14 by viwoo »

Re: who can write a Focus shooting Script for Sx40 hs
« Reply #5 on: 15 / July / 2012, 05:22:37 »
edit in PS
feel this Theory is right,but Shooting parameter and setting need to Research,to find best Combination in Portrait photography。

Re: who can write a Focus shooting Script for Sx40 hs
« Reply #6 on: 15 / July / 2012, 08:42:25 »
i changed code :sleep500  =sleep 1    and,test this script、in AV  MF mode About 85mm and edit in PS,look photo(this script‘s Interval time Seems to be useless 1 or 500 )
The sleep time is in milliseconds (one thousands of a second) so very short either way. It was there to give the camera a little time to focus before the second picture is taken.  It may not be needed ?

feel this Theory is right,but Shooting parameter and setting need to Research,to find best Combination in Portrait photography。
Please post your best results when you are finished.
« Last Edit: 15 / July / 2012, 09:14:59 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: who can write a Focus shooting Script for Sx40 hs
« Reply #7 on: 16 / July / 2012, 08:12:02 »
I have some test,SX40,use AV、TV、M、P mode ,AF this Script Invalid,must use MF。Focal length 24-200mm in room。Water quality is very poor English,gaga。。

 

Related Topics


SimplePortal © 2008-2014, SimplePortal