Timelapse Focus loss - CHDK or CAM? - Script Writing - CHDK Forum

Timelapse Focus loss - CHDK or CAM?

  • 8 Replies
  • 5165 Views
Timelapse Focus loss - CHDK or CAM?
« on: 20 / August / 2012, 18:17:11 »
Advertisements
I've been writting a script based on the basic intervalometer to be able to take shots faster but got a problem with focus after a couple of shots (after 1000).


I do shoot on manual mode and already set up the aperture and the speed.
Using Canon SX20 IS


The script is as follows:

@title Interval
@param a Interval (Secs)
@default a 1

set_aflock 1

do
  s = get_tick_count
    click "shoot_full_only"
  sleep a*1000 - (get_tick_count - s)
until ( 0 )


Results:
Timelaps

I do use set_aflock because it was the only to stop the camera from getting auto focus every shot (looses time).
As you can see, as time goes by, the camera slowly looses focus. During recording the screen doesn't turn off. Energy saving is disabled.

Re: Timelapse Focus loss - CHDK or CAM?
« Reply #1 on: 20 / August / 2012, 20:08:56 »
I'd typically expect to see something like this :

Code: [Select]
 
    ...
   press "shoot_half"
   sleep 2000
   release "shoot_half"

   set_aflock 1
   ...
 

to set the focus the first time before locking it.

If that doesn't have any effect,  you could periodically reset the focus with this inserted in your loop every couple of minutes ?

Code: [Select]
 
    ...
   set_aflock 0
   press "shoot_half"
   sleep 2000
   release "shoot_half"
   set_aflock 1
   ...
 

Also,  did you try using  click "shoot_full"  rather than  click "shoot_full_only" ?



Ported :   A1200    SD940   G10    Powershot N    G16

Re: Timelapse Focus loss - CHDK or CAM?
« Reply #2 on: 21 / August / 2012, 10:07:26 »
Focus is on manual mode (already focused).

Will try to change to shoot_full and make some tests.



Do anyone think that it could be that the camera is pointed upwards and slowly moves the lens?
Or any temperature change that change optical configuration of the lens?

Re: Timelapse Focus loss - CHDK or CAM?
« Reply #3 on: 21 / August / 2012, 11:00:23 »
To check whether it's mechanical or physical problem you could use 'get_focus' command for each shoot and for example log it to file. This way you'll know, whether focus value that is stored in memory is constant. If that's true then you can be sure, that this is more like hardware problem. If not - it is sofrware related.

If that's software problem you could use 'set_focus' command for each shoot (or each 10 or 20 shoots).

If it's mechanical you can refocus the lens each one or few shoots. I would try to set focus for some value very different from the desired one and then set focus back to the desired.

My proposal is rather guessing, but that's what seems logical for me.

Regards!
if (2*b || !2*b) {
    cout<<question
}

Compile error: poor Yorick

Re: Timelapse Focus loss - CHDK or CAM?
« Reply #4 on: 21 / August / 2012, 18:21:18 »
Tried shoot_full, didn't worked. Would not like to be focusing now and then because I want a good timelapse with no lags.

Here's what I'm doing right now for debugging: (as suggested)

@title Interval
@param a Interval (Secs)
@default a 10

print_screen 24
set_aflock 1
get_focus f
print "first focus", f
s=1

do
  get_focus g
  print "shoot", s, "focus", g
  click "shoot_full"
  s=s+1
  sleep a*1000
until ( 0 )

Have a doubt though. Does get_focus do another focusing or it just get the focus data?
If it just returns the actual focus value then the camera is still changing focus for a lower value then it stays around there!


Log results:

first focus 168801
shoot 1 focus 175629
shoot 2 focus 81782
shoot 3 focus 55009
shoot 4 focus 41017
shoot 5 focus 33723
shoot 6 focus 29122
shoot 7 focus 27085
shoot 8 focus 27257
shoot 9 focus 26829
shoot 10 focus 26407
shoot 11 focus 26656
shoot 12 focus 28067
shoot 13 focus 27878
shoot 14 focus 27085
shoot 15 focus 30585
shoot 16 focus 26909
shoot 17 focus 29424
shoot 18 focus 28348
shoot 19 focus 31954
shoot 20 focus 27257
shoot 21 focus 29020
shoot 22 focus 29320
shoot 23 focus 29626
shoot 24 focus 30361
shoot 25 focus 31250
shoot 26 focus 27698
shoot 27 focus 31598
shoot 28 focus 33586
shoot 29 focus 32078
shoot 30 focus 29626
shoot 31 focus 32690
shoot 32 focus 28918
shoot 33 focus 29626
shoot 34 focus 27522
shoot 35 focus 27972
shoot 36 focus 27792
shoot 37 focus 30585
shoot 38 focus 29424
shoot 39 focus 30689
shoot 40 focus 30585
shoot 41 focus 29020
shoot 42 focus 28535
shoot 43 focus 31025
shoot 44 focus 26829
shoot 45 focus 33327
shoot 46 focus 28251

Any suggestions?

Re: Timelapse Focus loss - CHDK or CAM?
« Reply #5 on: 21 / August / 2012, 20:04:31 »
Tried shoot_full, didn't worked.
Can you be more specific please ?  It should have worked. Please post the actual script you tried.

Quote
Would not like to be focusing now and then because I want a good timelapse with no lags.
I understand that but if all else fails,  it might be better to do that than have a lot of your timelapse video be out of focus.

Quote
Have a doubt though. Does get_focus do another focusing or it just get the focus data?
Hard to tell looking at the CHDK code - it basically calls functions from the Canon ROM.  I'd have to setup a script and experiment to get a better answer but I would not expect it to change the focus.  However,  the click "shoot_full" might be causing the camera to reevaluate the focus setting even if it does not actually move the lens.
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Timelapse Focus loss - CHDK or CAM?
« Reply #6 on: 21 / August / 2012, 20:36:58 »

Even if I use click "shoot_full" instead of shoot_full_only" I still get the progressing focus loss after some shoots. In my last post with log I'm using shoot_full.

From what it looked liked to me (hearing and seeing cam as it progresses through shoots), using shoot_full after set_aflock 1 doesn't do any focusing anymore. Looks like a matter of losing focus than refocusing.

Another strange thing that i noticed one time: when i stopped the script and gonne to change the focus, the option on screen was still showing focus on background though the image was blured, i did change the focus and everything gone OK. Was like the option value didn't match the camera real focus.

Do you think that my script was writed correctly? If so, focus values in each photo varies from the initial focus value.

Thank you in advance.

Re: Timelapse Focus loss - CHDK or CAM?
« Reply #7 on: 21 / August / 2012, 21:08:57 »
Do you think that my script was writed correctly? If so, focus values in each photo varies from the initial focus value.
Here's my guess - and I have been know to be wrong at time.  The value you are printing is some sort of internal value calculated by the camera based on its focus algorithm telling it where the point of focus of the lens is. Its not moving the lens, just calculating where the lens is focused.  That would be consistent with what set_aflock does.  Its quite possible that the lens positioning system drifts all by itself over time -  normally that would not be a problem as the camera refocuses before each shot.

Ported :   A1200    SD940   G10    Powershot N    G16

Re: Timelapse Focus loss - CHDK or CAM?
« Reply #8 on: 22 / August / 2012, 15:05:06 »
OK.

I'll be toying wit set_aflock, set_focus and set_prop(65) and will post something when I can do some timelapse whose works.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal