Author Topic: Full-press without releasing half-press  (Read 2120 times)

Offline funnel

  • Sr. Member
  • ****
  • Posts: 265
Re: Full-press without releasing half-press
« Reply #15 on: 28 / July / 2011, 14:27:57 »
Will this ever be added to the trunk?

Offline msl

  • Sr. Member
  • ****
  • Posts: 369
  • A720 IS, SX220 HS
    • CHDK inside
Re: Full-press without releasing half-press
« Reply #16 on: 28 / July / 2011, 15:36:02 »
Will this ever be added to the trunk?

Was added in CHDK-DE (rev. 711) for testing this feature.

msl

Offline openuas

  • Rookie
  • *
  • Posts: 44
  • OpenUAS
    • OpenUAS
Re: Full-press without releasing half-press
« Reply #17 on: 23 / August / 2011, 23:01:02 »
That is great! Just starting my quest to optimize the speed of pictures taken per timeframe if remote trigger via USB is used. IMO it would be great if the improvement ends up in the regular CHDK asap. Used SDHC UHS 1, and the write speed is for sure not the bottleneck anymore according to my tests.

Offline trismarck

  • Rookie
  • *
  • Posts: 18
Re: Full-press without releasing half-press
« Reply #18 on: 26 / September / 2011, 16:06:13 »
Hi,

I've stumbled on this issue also when learning CHDK scripts.
I haven't tested the CHDK DE update.
The workaround for the AllBest CHDK (build 1324) would be to use set_aflock.
Example1:
Code: [Select]
@title shoot
rem Lets suppose shoot_half is pressed all the time.
rem (camera uses autofocus only one time)
rem Will the camera skip the autofocus process
rem if shoot_full is clicked / pressed?

rem Yes.
rem Glitch: click         "shoot_full"  and
rem         press/release "shoot_full"   will release
rem         the shoot_half button also. (unintuitive)
rem         Problem: if "shoot_half" is released after
rem taking the first picture, the camera will
rem have to refocus when taking second picture
rem (refocus using either shoot_half or shoot_full).
rem Conclusion: when I take the many pictures
rem => no skipping autofocus for the second
rem and later pictures possible.
rem Solution: set_aflock (see next script).

rem The script:
  print "shoot_half will be pressed in 5sec."
  sleep 5000
  press "shoot_half"
rem The camera catches focus.
  sleep 5000

  print "shoot_full will be pressed in 5 sec."
  sleep 5000
  press "shoot_full"
  sleep 5000
  release "shoot_full"
rem shoot_half button released also. (unintuitive)

  print "shoot_full will be pressed in 5 sec."
  sleep 5000
rem Camera catches focus again as shoot_half was already
rem (unintentionally) released earlier (unintuitive)
  click "shoot_full"
  sleep 5000
 
rem release shoot_half does nothing as shoot_half was already
rem released earlier by 'release "shoot_full"'
  release shoot_half
end

Example2: (set_aflock)
Code: [Select]
@title shoot - aflock
rem I can take multiple pictures without refocusing
rem using shoot_half, set_aflock and shoot_full.

  print "shoot_half will be pressed in 5sec."
  sleep 5000
  press "shoot_half"
rem The camera catches focus.
  sleep 3000
  release "shoot_half"
rem Lock the focus.
print "---Locking the focus.---"
  set_aflock 1

  print "shoot_full will be pressed in 5 sec."
  sleep 5000
  press "shoot_full"
rem shoot_full skips the autofocusing process
rem because of set_aflock. (success)
  sleep 5000
  release "shoot_full"

  print "shoot_full will be pressed in 5 sec."
  sleep 5000
  click "shoot_full"
  sleep 5000

print "---Unlocking the focus.--"
  set_aflock 0

  print "shoot_full will be pressed in 5 sec."
  sleep 5000
  click "shoot_full"
rem shoot_full uses autofocusing again, as AutoFocus lock
rem is disabled.
  sleep 5000
 
end

///edit: fixed the code as the 'rem ' sections were too long and the script would hang.
//edit2: tested in Av, M modes (a590), Focus: Macro.
« Last Edit: 26 / September / 2011, 16:22:37 by trismarck »

Online philmoz

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1180
    • Photos
Re: Full-press without releasing half-press
« Reply #19 on: 27 / September / 2011, 14:46:32 »
Will this ever be added to the trunk?

Added in changeset 1344.

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)

Offline dvip

  • Full Member
  • ***
  • Posts: 171
Re: Full-press without releasing half-press
« Reply #20 on: 28 / September / 2011, 04:18:24 »
Very nice!
So what's the official lua script to test this?

« Last Edit: 28 / September / 2011, 04:19:59 by dvip »

Offline waterwingz

  • Guru Member
  • ******
  • Posts: 2022
Re: Full-press without releasing half-press
« Reply #21 on: 28 / September / 2011, 05:34:34 »
Very nice!
So what's the official lua script to test this?

Here you go,  this is < msl's interval shoot > script from 11-July-2011 converted to Lua.  The results are impressive - with no shooting the loops take 12 seconds,  with shoot_full_only() they take 12.9 seconds while using shoot() takes 23.2 seconds on my G10.

Code: [Select]
--[[
@title Interval shooting

@param a Shoot count
@default a 5
@param b Interval (Minutes)
@default b 0
@param c Interval (Seconds)
@default c 3
--]]

set_console_layout(10, 0, 40, 14)

t=b*60000+c*1000
if a<2 then a=10 end
if t<1000 then t=1000 end

sleep(2000)

k = get_tick_count()
print("Shoot 1 of", a)
shoot()

for n=2,a do
    sleep(t)
    print("Shoot", n, "of", a)
    shoot()
end
l = get_tick_count() - k

sleep(2000)

m = get_tick_count()
print("Shoot 1 of", a)
click("shoot_full_only")

press("shoot_half")
for n=2,a do
    sleep(t)
    print("Shoot", n, "of", a)
    click("shoot_full_only")
end
release("shoot_half")
n = get_tick_count() - m

print("interval", t * (a-1), "ms")
print("shoot", l, "ms")
print("shoot only", n, "ms")


Offline dvip

  • Full Member
  • ***
  • Posts: 171
Re: Full-press without releasing half-press
« Reply #22 on: 28 / September / 2011, 07:16:38 »
waterwingz,
It is great!
I just tested it in my A590is (a590-101b-0.9.9-1344-full.zip).

Thanks!

Now what  I'm looking for is,  a short lua script that can:

1. Focus
2. Lock focus
3. Allow some time for composition
4. Shoot (without refocusing)



Offline waterwingz

  • Guru Member
  • ******
  • Posts: 2022
Re: Full-press without releasing half-press
« Reply #23 on: 28 / September / 2011, 07:34:18 »
Now what  I'm looking for is,  a short lua script that can:
1. Focus
2. Lock focus
3. Allow some time for composition
4. Shoot (without refocusing)
Something like :
Code: [Select]
--[[
@title Focus Lock
@param a = delay (sec)
@default a 10
--]]

sleep(1000)
press("shoot_half")
repeat sleep(50) until get_shooting() == true
release("shoot_half")
repeat sleep(50) until get_shooting() == false

set_aflock(1)
sleep(a*1000)
shoot()
set_aflock(0)


CHDK Forum

Re: Full-press without releasing half-press
« Reply #23 on: 28 / September / 2011, 07:34:18 »

Offline dvip

  • Full Member
  • ***
  • Posts: 171
Re: Full-press without releasing half-press
« Reply #24 on: 28 / September / 2011, 08:30:42 »
Very nice, waterwing! :D

It works great.
I like the fact that I can change the number of seconds to re-compose.

I noticed the cam turns the af-assist-beam led twice before locking focus.

Offline waterwingz

  • Guru Member
  • ******
  • Posts: 2022
Re: Full-press without releasing half-press
« Reply #25 on: 28 / September / 2011, 08:43:11 »
I noticed the cam turns the af-assist-beam led twice before locking focus.
Hmmm ... set_aflock(1) also seems to focus rather than just lock the current focus point.  Hence the two af-assist-beams you saw.   Looks like you can probably delete the code between the sleep(1000) and set_aflock(1) and it would work the same way.

Offline dvip

  • Full Member
  • ***
  • Posts: 171
Re: Full-press without releasing half-press
« Reply #26 on: 29 / September / 2011, 05:00:57 »
--[[
@title Focus Lock
@param a = delay (sec)
@default a 3
--]]
sleep(1000)
set_aflock(1)
sleep(a*1000)
shoot()
set_aflock(0)

Yep, set_aflock(1) can focus. But I don't get the green square that confirms the focus, just a white one. But I still like it.

Offline waterwingz

  • Guru Member
  • ******
  • Posts: 2022
Re: Full-press without releasing half-press
« Reply #27 on: 29 / September / 2011, 06:45:39 »
short scripts that do what you want them to are always good

 


SimplePortal 2.3.3 © 2008-2010, SimplePortal