Focus/Shutter speed set, too slow - Script Writing - CHDK Forum

Focus/Shutter speed set, too slow

  • 15 Replies
  • 9179 Views
*

Offline bugbear

  • **
  • 57
  • A630
    • woodwork on geocities
Focus/Shutter speed set, too slow
« on: 16 / July / 2016, 03:17:07 »
Advertisements
In my other thread https://chdk.setepontos.com/index.php?topic=12921.0 I said

I've coded a simple get_dof based focus stacking script, which works nicely for me.

I then enable TV bracketing in CHDK, take 5 shots, and get a permuted sequence of images.


This is all true, and all works as I intended. What I hadn't foreseen is that Custom Timer on the Canon A630
has a 2 second pause between shots, does an exposure measurement, and uses the focus assist light (even in manual focus mode?!).

So - I need to go off and change stuff.

Is there a "known best/fastest" way to do these brackets in a script?

Otherwise, I guess I'll just be googling the archive.

EDIT; Am I wasting my time continuing to work in uBasic? It appears that Lua is where the develpement is most active now.

     BugBear
« Last Edit: 16 / July / 2016, 03:31:40 by bugbear »

*

Offline bugbear

  • **
  • 57
  • A630
    • woodwork on geocities
Re: Focus/Shutter speed set, too slow
« Reply #1 on: 16 / July / 2016, 06:08:28 »
In case people think I'm just complaining, I'm not. CHDK has already proved in principle
that the shot I want to get is doable - I just want to refine it from proof-of-concept to
easy-to-use-tool.

Over in the world of DIY HiFi, some shots of circuit boards and/or the insides of amplifiers
are lacking in DOF and/or shadow/highlight detail.

Combined Focus and Shutter stacking should solve that...  :D

My first trial shot attached, after processing, first with Enfuse, then with CombinZP under Wine, all under Ubuntu 14.04, tied together with dirty perl scripts.

  BugBear
« Last Edit: 16 / July / 2016, 06:10:06 by bugbear »

Re: Focus/Shutter speed set, too slow
« Reply #2 on: 16 / July / 2016, 09:37:09 »
In my other thread https://chdk.setepontos.com/index.php?topic=12921.0 I said
...
Now that you mention it, I should point out that CHDK forum etiquette is to not start multiple new threads on what is basically the same topic (in this case, your focus stacking project).  Doing so will not get you more, or better, or faster responses as the small number of forum member likely to respond read pretty much every post in every thread.  But spreading things out make it a lot harder to search for them later or for people wanting to learn from your project to be able to read the progress all in one place.   TIA.


Quote
Is there a "known best/fastest" way to do these brackets in a script?
Yes. A better sequence is to code a "half press",  wait for the camera to set focus and exposure,  override those as necessary, and then do a "full press" repeatedly, modifying exposure, focus, or zoom as required between each "full press". When the script is done, release the "half press".

Code Reference :  Fast Shooter Intervalometer  and HDR Fast Shooter

Quote
Otherwise, I guess I'll just be googling the archive.
Always a good idea. Here are two short cuts : CHDK Links and User_Written_Scripts
Quote
EDIT; Am I wasting my time continuing to work in uBasic? It appears that Lua is where the develpement is most active now.
Short answer ?  Yes.  The B stands for beginner.  At some point, it just gets too hard to do more sophisticated things in BASIC in a manner that is readable, maintainable, supportable, and reliable. Lua is simply much more capable. For a simple example of this consider that uBASIC's restriction to single character variable names is enough to make it painful to use. And there are many more limitations.

In case people think I'm just complaining, I'm not.
I don't think anyone thinks that you are complaining.  Your questions and issues are pretty much normal for someone doing a project with a new tool for the first time.
« Last Edit: 16 / July / 2016, 09:48:25 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline bugbear

  • **
  • 57
  • A630
    • woodwork on geocities
Re: Focus/Shutter speed set, too slow
« Reply #3 on: 16 / July / 2016, 09:52:28 »
In my other thread https://chdk.setepontos.com/index.php?topic=12921.0 I said
...
Now that you mention it, I should point out that CHDK forum etiquette is to not start multiple new threads on what is basically the same topic (in this case, your focus stacking project).

Apologies - on other forums I'm used to one question per thread, not one project per thread.

I shall continue in this thread, (and follow up all the other helpful links/answers you posted, thank you).

 BugBear


Re: Focus/Shutter speed set, too slow
« Reply #4 on: 16 / July / 2016, 09:58:49 »
Apologies - on other forums I'm used to one question per thread, not one project per thread.

I shall continue in this thread, (and follow up all the other helpful links/answers you posted, thank you).
Thank you. 

It's not that big a deal or someone would have mentioned it sooner.  Mostly we have to jump hard on newbie who post exactly the same question in multiple threads without even waiting for an answer.  On busy chat forums I expect that can be necessary.  Here it's just annoying and makes things hard to search for later.  And in your years here you've probably already discovered how important forum searching is and how difficult it can be  8)

If you want to post your script here at any time, some of the regular forum members will probably take a look and make helpful suggestions if we see any.  It's entirely up to you but we take some pride in not being negative or judgmental - this is just a hobby for most of us.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline bugbear

  • **
  • 57
  • A630
    • woodwork on geocities
Re: Focus/Shutter speed set, too slow
« Reply #5 on: 16 / July / 2016, 10:03:06 »
One last question for the moment (and my first question on Lua).

I'm bound to struggle with syntax to start with; is there a Linux resident Lua interpreter/environment where I could at least get my syntax checked before I load to a card for actual use/testing?

Having to continually swap SD cards just to chase out syntax errors is annoying!

 BugBear

Re: Focus/Shutter speed set, too slow
« Reply #6 on: 16 / July / 2016, 10:08:05 »
I'm bound to struggle with syntax to start with; is there a Linux resident Lua interpreter/environment where I could at least get my syntax checked before I load to a card for actual use/testing?
Yup.  I'll do some digging and post back here if msl does not post first ;)

Also,  if you use chdkptp to load scripts directly over USB it is a whole lot less painful doing development when you don't have to swap SD cards with each edit.  Cycle time becomes about the same as running in a simulator without the limitations.  It's a bit of work to setup but well worth it in the long run!

Update :  Execute Lua scripts with hostlua & notepad++
« Last Edit: 16 / July / 2016, 10:13:46 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline bugbear

  • **
  • 57
  • A630
    • woodwork on geocities
Re: Focus/Shutter speed set, too slow
« Reply #7 on: 18 / July / 2016, 05:06:55 »
The HDRLapse.lua from December 2013 has some nicely coded routines to convert APEX 96 data (had to google that, no Links in the Wiki) into "user" comprehensible terms;

Code: [Select]
function print_tv(val)
function print_av(val)
function print_sv(val)

e.g.
Code: [Select]
av_ref = {     160, 176,   208,  243,  275,  304,  336,  368,  400,  432,  464,  480,  496,  512,  544,  592,  624,   656,   688,   720,  752,   784 }
av_str = {"n/a","1.8", "2.0","2.2","2.6","2.8","3.2","3.5","4.0","4.5","5.0","5.6","5.9","6.3","7.1","8.0","9.0","10.0","11.0","13.0","14.0","16.0","hi"}

function print_av(val)
    if ( val == nil ) then return("-") end
    local i = 1
    while (i <= #av_ref) and (val > av_ref[i]) do i=i+1 end
    return av_str[i]
end

I assume these have now been obseleted by av96_to_aperture (although reeading the spec, that returns f-stop * 1000, not a nice "F stop name" per your code above.

What's current (2016!!) best-practice?

 BugBear


Re: Focus/Shutter speed set, too slow
« Reply #8 on: 18 / July / 2016, 08:17:52 »
(had to google that, no Links in the Wiki)
Well,  it's not exactly easy to find, but the link to the Doug Kerr APEX article is here : CHDK Links : Other Random CHDK Links .  His method is then scaled by a factor of 96 to make integer math work better (and work in 1/3 f-stop increment cleanly).

Quote
I assume these have now been obsoleted by av96_to_aperture (although reading the spec, that returns f-stop * 1000, not a nice "F stop name" per your code above).
Pretty much. Those function were added to make conversion easy.  But as you have noted,  they will tend to produce technically accurate but "non standard" results  (e.g. shutter speed = 1/68 second vs just 1/60 second).

Quote
What's current (2016!!) best-practice?
It's entirely up to your personal preference.  One way saves coding, debugging, and reduces program size.  The other way gives a nicer output (IMHO) but is more complex,takes up more code space, and likely runs a tiny little bit slower.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Offline bugbear

  • **
  • 57
  • A630
    • woodwork on geocities
Re: Focus/Shutter speed set, too slow
« Reply #9 on: 19 / July / 2016, 04:43:05 »
Sub-thread: shoot_full, shoot_half, shoot_full_only?


EDIT; my intention is to have the camera in full manual mode, with manual focus set on my chosen near point prior to triggering the script. Shooting a focus/exposure stacked set on a tripod is not something I'm going to do spontaneously!!

I have been deriving much CHDK and Lua knowledge from HDRLapse.lua.

But I am confused by its use of shoot_half/shoot_full_only.

My initial assumption was that by carefully pressing shoot_half, one could then gain speed by repeatedly using shoot_full_only as the "main" operation, finally releasing shoot_half, emulating the two stages of the physical shutter button, where it is impossible to press "full" without first pressing "half".

However, this is not what HDRLapse does, at least in "fast mode"

Having decode the two options controlled by shot_mode ("fast" and "burst" AKA continuous) I discover that:

In fast mode
    shoot_half is pressed, the exposure parameters gathered, and shoot_half is then released.
    in the HDR loop a standalone shoot_full_only is used to take each shot.
    (all presses and releases are followed by a get_shooting() busy loop to detect/confirm the desired change of state)

In "burst" mode
  shoot_half is pressed and held
  in the HDR loop shoot_full_only is pressed
  a busy_loop on get_exp_count() runs, and then
  shoot_full_only is released.
  no checking of get_shooting() is done.

So - while extra contextual information is welcome - my question is:

If I have preset, or am automagically setting, my exposure parameters, can I use "shoot_full_only" on its own (i.e. without "shoot_half") as a faster method than "shoot_full"?

  BugBear
« Last Edit: 19 / July / 2016, 04:46:45 by bugbear »

 

Related Topics