Landscape Focus Bracketing Script - page 14 - Completed and Working Scripts - CHDK Forum supplierdeeply

Landscape Focus Bracketing Script

  • 144 Replies
  • 5579 Views
Re: Landscape Focus Bracketing Script
« Reply #130 on: 13 / January / 2020, 13:15:35 »
Advertisements
@c_joerg


CHDK’s limits are quoted as 0 to 65535 (millimeters)


*

Offline reyalp

  • ******
  • 12309
Re: Landscape Focus Bracketing Script
« Reply #131 on: 13 / January / 2020, 13:21:40 »
CHDK’s limits are quoted as 0 to 65535 (millimeters)
That's outdated. On many modern cams, it goes beyond 64K. But which values correspond to distinct focus settings and when it starts reporting -1 is not well specified.
Don't forget what the H stands for.

Re: Landscape Focus Bracketing Script
« Reply #132 on: 13 / January / 2020, 17:40:59 »
@c_joerg

I wrote this script for my photography needs, which are highly biased towards wide angle photography, so I never tested the script at the long end.

The script uses the CHDK hyperfocal's CoC as the overlap, hence when you choose CoC/2, the script scales the CHDK H to 2*H when bracketing up to H/3. It then inserts two other images at H and H times the infinity criterion you selected.

Your example needed a large number of brackets. BTW you can get an estimate of the number of brackets from (1+H/x)/2. In your example the CHDK H is 19933 which is doubled as you chose CoC/2. You started at 687, which means about 30 brackets.

I've changed the code and now you can specify the maximum number of brackets. I personally think 10 is a good max, but it's your choice.

I've also changed the code so that it doesn't hang, ie it just terminates that part of the bracketing if it has a problem. That is you should always get something.

The latest version can be downloaded from here as usual: https://gist.github.com/pigeonhill/7056282940415f7d99e0cc8688f48a0d

Bottom line: if things start terminating at a (long) focal length, then back off the overlap and/or shut down the aperture, ie lowering the hyperfocal. You may get more diffraction, but that's life  ;)

Once again, thanks for the testing and feedback.

Re: Landscape Focus Bracketing Script
« Reply #133 on: 14 / January / 2020, 13:11:15 »
@reyalp


I’m finalising a new release of my script and am testing it out and noticed a ‘strangeness’.


The version is here https://gist.github.com/pigeonhill/7056282940415f7d99e0cc8688f48a0d


The strangeness is that as the script progresses I notice that the CHDK hyperfocal distance seems to change between taking an image and moving the lens, eg 2.84 vs 3.01.


The obvious strangeness is, without changing focal length or aperture, why does the CHDK reported hyperfocal change.


Is this expected?


BTW I am thinking of explicitly calculating H myself, rather than rely on CHDK reporting.


*

Offline reyalp

  • ******
  • 12309
Re: Landscape Focus Bracketing Script
« Reply #134 on: 14 / January / 2020, 16:32:20 »
The strangeness is that as the script progresses I notice that the CHDK hyperfocal distance seems to change between taking an image and moving the lens, eg 2.84 vs 3.01.

The obvious strangeness is, without changing focal length or aperture, why does the CHDK reported hyperfocal change.

Is this expected?
Without digging deeply into either the DOF calculator code or the script, I'd guess some value in the calculation is only updated in halfpress, or calculated differently when not in half press. The most likely candidate is aperture.
Don't forget what the H stands for.

Re: Landscape Focus Bracketing Script
« Reply #135 on: 14 / January / 2020, 17:15:17 »
@reyalp

Sorry, I appreciate I'm asking a difficult question without you spending time looking at my code.
However, I have looked into the strangeness, and it doesn't appear to be my code.
If I put my G1X into M mode and MF and do a half shutter press, the CHDK reported hyperfocal distance changes.
As I say, strange.

*

Offline reyalp

  • ******
  • 12309
Re: Landscape Focus Bracketing Script
« Reply #136 on: 14 / January / 2020, 17:35:22 »
If I put my G1X into M mode and MF and do a half shutter press, the CHDK reported hyperfocal distance changes.
Sorry, I guess the previous reply wasn't clear:
* Some information is only updated on halfpress, or only reflects what the camera will use during half press. This is a characteristic of the Canon firmware, not just CHDK or your script.
* The DOF calculator code (see http://subversion.assembla.com/svn/chdk/trunk/core/shooting.c shooting_update_dof_values) does things differently depending on various conditions, including whether get_shooting() is true.
* I did not write this and do not fully understand either the code or the original intent. Some aspects of it appear questionable to me.
* Bottom line: getting different results in / out of half press is not surprising. Values obtained in half press should be more likely to be right, but there could be bugs in either case.
Don't forget what the H stands for.

Re: Landscape Focus Bracketing Script
« Reply #137 on: 14 / January / 2020, 17:46:29 »
@reyalp

Thanks for the education, I'll look into things and decide what way to go, i.e. live with the CHDK data, or generate my own.

Cheers

Garry


*

Offline reyalp

  • ******
  • 12309
Re: Landscape Focus Bracketing Script
« Reply #138 on: 14 / January / 2020, 18:28:39 »
Thanks for the education, I'll look into things and decide what way to go, i.e. live with the CHDK data, or generate my own.
FWIW, if you decide to roll your own, you'll most likely still have to address the half press or not issue, but you get to decide how to do it. If you operate only in M mode, you can use the USER propcases, which should always reflect the set value.

One of the parts of the current DOF calculator that I find questionable is that it uses shooting_get_current_av96 (in some case, the logic of which aren't immediately obvious to me), which is the current physical aperture value at the time of the call. This may not reflect the set aperture at all, even in half press.  I actually expected shooting_get_current_av96 to reflect the set value in half press, but from testing on g7x just now that does not appear to be the case.
Don't forget what the H stands for.

Re: Landscape Focus Bracketing Script
« Reply #139 on: 15 / January / 2020, 01:49:39 »
@reyalp

Quote
but you get to decide how to do it.

I only need get the focal length, CoC and aperture at the start of the script.

I don't change aperture, just use it to calculate diffraction. I currently use dof.aperture, I wonder if I should use get_user_av96 instead?

One thing I'll do is switch off CHDK DoF feedback and explicitly screen print out the progress in the script, eg focus and how many brackets will be needed etc.

I also use get_tv96() and get_av96(). Once again, any suggestion regarding getting the 'correct' values would be welcome. For example, is this the 'best' way:

Code: [Select]
press("shoot_half")   
repeat sleep(10) until get_shooting()
s = get_tv96()   
av = get_av96()
release("shoot_half")
repeat sleep(10) until (not get_shooting())

I guess the same question for setting. I currently use

Code: [Select]
set_tv96_direct(s)
set_av96_direct(av)
set_sv96(sv96_market_to_real(iso_to_sv96(1600)))
Do you consider this the 'best way'

Once again, thanks for your assistance in helping me understand the differences between my normal Lua environment (ML) and CHDK's.
« Last Edit: 15 / January / 2020, 01:51:56 by pigeonhill »

 

Related Topics