Bracketing in continuous mode: subject distance - General Help and Assistance on using CHDK stable releases - CHDK Forum

Bracketing in continuous mode: subject distance

  • 14 Replies
  • 4596 Views
Bracketing in continuous mode: subject distance
« on: 03 / February / 2020, 07:54:27 »
Advertisements
Maybe someone can throw some light on what I see on multiple cameras.


When I use subject distance bracketing in continuous mode, I don’t see a correlation between the numbers I enter and the result. 


To be clear, I’m not expecting to see perfection.


As an example, I focus at 200mm, set the bracketing to + and distance to 100. Based on this I would expect the cam to move to around 300mm. But what I see is the cam move to 400, ie it’s moved 200, not 100.


This is repeatable at any distance.


I’ve looked at the shooting.c code and it looks ok, ie I can’t see an error.


As I say, can someone educated me  ;)

Re: Bracketing in continuous mode: subject distance
« Reply #1 on: 03 / February / 2020, 08:08:09 »
Ok I think I worked it out, but I think there is still something wrong.


I set 2 in the customer timer, and use, say, Tv bracketing in continuous mode, I get two images, ie one at the base and one at the delta Tv Ev.


In subject mode it looks like I get one at step 1, ie 200, and one at step 2, ie 300 in the above example. Which I believe is not right. That is you don’t get an image attn3 base.


I’ll carry on investigating.

Re: Bracketing in continuous mode: subject distance
« Reply #2 on: 03 / February / 2020, 08:36:07 »
Ok strange, but manageable.


If you set subject distance to x and you start at y and you set custom timer to 2 shots, you end up at y+2x.


If you set custom timer for 3 shots you end up at y+3*x.


Plus the usual caveats that moves become ‘flacks’ beyond, say, the hyperfocal/2.


Bottom line, I am interested in a two image situation, thus all I need to do is set the bracketing subject distance to half of what I want and I will end up bracketing at the start and at the double the set subject distance.


Unless I’ve got it all wrong  ;)

Re: Bracketing in continuous mode: subject distance
« Reply #3 on: 03 / February / 2020, 08:46:53 »
Or it seems you need to play with the bracketing logic.


Use -/+ instead of + gives you what you need for a 2 image bracket set  :)
« Last Edit: 03 / February / 2020, 08:55:35 by pigeonhill »

*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: Bracketing in continuous mode: subject distance
« Reply #4 on: 03 / February / 2020, 11:37:00 »
I've been doing some testing with set_focus / log get_focus on the a490, s95 e&k and s110
Have done about 10 runs on each
however, i have very inconsistant results. (infinity= -1)
these are the last runs in 50mm steps with AF, MF and AFL on 3 model S95..
sky means the cam was just pointed up at the clouds.
the S110 does not work with AFL yet and the A490 lacks MF, i only have 100mm runs of these at the moment.
The S95-100K (last one) was on external power supply and i have had much better runs from that one on 100mm, this was just the most off ever.
I noticed on MF that one cam on one run focussed at 10cm between shots (or at least very close)
I also noticed that another cam on AF focussed at infinity between shots .
I had syncronised settings in CF and CHDK before i started running, however S95-100E did not give a enlarged square in MF, so maybe i missed something.
after the first runs I added a 2 sec sleep after the set_focus and put the interval from 5 to 12 seconds to give everything enough time.

enclosed are the results of a few 50mm runs, and i'm just wondering what went wrong.
« Last Edit: 03 / February / 2020, 12:41:52 by Mlapse »
frustration is a key ingredient in progress

Re: Bracketing in continuous mode: subject distance
« Reply #5 on: 03 / February / 2020, 18:31:52 »
@Mlapse

At the moment I'm investigating some strangeness with bracketing in continuous mode with subject distance.

As I said earlier, if I Tv bracket I see what I expect if, say, I use + as the bracketing strategy i.e. BaseTv, BaseTv+delEv, BaseTv+2*delEv etc

If I do the above with subject distance I get BaseFocus, BaseFocus+2*delDistance, BaseFocus+3*delDistance, which I believe to be wrong.

I've looked at shooting.c but I can't work out where it's 'going wrong'.


*

Offline Mlapse

  • *****
  • 584
  • S95 S110
Re: Bracketing in continuous mode: subject distance
« Reply #6 on: 04 / February / 2020, 02:29:18 »
i simply did set_focus(shotnumber*50) and was expecting to see at least the same numbers with the same cam model. but every run seems different, even if i have not changed settings.
if you need help with your investigation, let me know.
« Last Edit: 04 / February / 2020, 02:40:38 by Mlapse »
frustration is a key ingredient in progress

Re: Bracketing in continuous mode: subject distance
« Reply #7 on: 04 / February / 2020, 02:56:56 »
@reyalp

This has really been bugging me, especially as I wish to use SD bracketing in continuous mode (BICM) in a Lua script I'm playing with.

The issue is the SD move in the second image in a bracketing sequence when using BICM with the Canon custom timer, ie taking an explicit number of images.

As an example, if I use the Canon custom timer to control SD BICM, set manual focus to Cam min, ie 50mm on my G7X, and use a BICM delta of 100 I get the following results reported in the CHDK DoF [Canon Custom Timer (#images), SD in DoF for last image]. I've rounded the following for presentation:
[1, 150]
[2, 250]
[3, 350]
[4, 450]

What I might expect to see would be:
[1, 50]
[2, 150]
[3, 250]
[4, 350]

So here's the 'problem', with custom timer set to 1, ie just take 1 image, the SD is moved by one SD-delta.

Thus, when, for example, I set a custom timer number of shots to, say, 2, the first short in the above will be taken at 50, but this will move focus to 150, then shot 2 will be taken and focus moved again to 250, thus we see reported 250.

I've repeated the above with an SD-delta of 1000, starting at an SD of 1000. The CHDK DoF info shows the final SD as 3000 (ignoring minor differences).

But the EXIF always shows the correct distances, ie 1000 and 2000 above.

So, we have a bit of a problem Houston  :)

For those using the screen DoF reporting, which I assume is the one used in Lua, we are not seeing the 'truth'.

Here is the relevant section in shooting.c

Code: [Select]
static void shooting_subject_distance_bracketing(int when)
{
    // first shot? (actually this is called just after the first shot has been taken)
    if (bracketing.shoot_counter == 0)
    {
        bracketing.subj_dist = shooting_get_subject_distance();
        bracketing.subj_dist_step = conf.subj_dist_bracket_value;
    }

    // Adjust delta SD value for shot based on shot number
    bracketing.dsubj_dist += (bracketing.subj_dist_step * bracket_delta[conf.bracket_type][bracketing.shoot_counter&1]);
    // Calculate new SD
    int value = bracketing.subj_dist + (bracketing.dsubj_dist * bracket_steps[conf.bracket_type][bracketing.shoot_counter&1]);
    if (value < CAMERA_MIN_DIST) value = CAMERA_MIN_DIST;
    else if (value > CAMERA_MAX_DIST) value = CAMERA_MAX_DIST;

    // Inc for next shot
    bracketing.shoot_counter++;

    // Apply value for next shot to be taken
    shooting_set_focus(value, when);
}

I'm not sure where the bracket counter "bracketing.shoot_counter" gets set, but let's assume it is zero after the first shot is taken. The code then calcs the next focus step and sets focus, ie "shooting_set_focus(value, when)", even if the number of custom timer images is 1, ie just the base image is taken.

IMHO I think this hints at where the code might need 'tweaking'. But I would value your thoughts before 'wasting' my time further.
« Last Edit: 04 / February / 2020, 04:13:08 by pigeonhill »

Re: Bracketing in continuous mode: subject distance
« Reply #8 on: 04 / February / 2020, 12:01:30 »
@reyalp

Looking at the three similar code sections, and looking at their behavior, there is a difference.

If we take Tv bracketing, like, SD bracketing, it sets up for the next shot. But, after n brackets, ie n specified in the customer timer, the exposure is reset to the base exposure at the start.

What I think is happening to SD bracketing is, if we take a 2 image bracket, this:

- Canon takes the base image
- shooting.c adjusts focus
- Canon takes the next image, ie the last image from the Canon controlled side
- but shooting.c doesn't seem to know this thus adjust focus as if it is going to take another image

But how to fix it?

I wonder if we can put in a test, something like this:
Code: [Select]
static void shooting_subject_distance_bracketing(int when)
{
    // first shot? (actually this is called just after the first shot has been taken)
    if (bracketing.shoot_counter == 0)
    {
        bracketing.subj_dist = shooting_get_subject_distance();
        bracketing.subj_dist_step = conf.subj_dist_bracket_value;
    }

    // Adjust delta SD value for shot based on shot number
    bracketing.dsubj_dist += (bracketing.subj_dist_step * bracket_delta[conf.bracket_type][bracketing.shoot_counter&1]);
    // Calculate new SD
    int value = bracketing.subj_dist + (bracketing.dsubj_dist * bracket_steps[conf.bracket_type][bracketing.shoot_counter&1]);
    if (value < CAMERA_MIN_DIST) value = CAMERA_MIN_DIST;
    else if (value > CAMERA_MAX_DIST) value = CAMERA_MAX_DIST;

    // Inc for next shot
    bracketing.shoot_counter++;

    // Apply value for next shot to be taken
if (bracketing.shoot_counter <= props.TIMER_SHOTS) {shooting_set_focus(value, when)};
}

That is, 'just' add in the test at the end. But note I don't know if props.TIMER_SHOTS is the right code in C


Also you would need to ensure the refocus works if custom timer not being used.
« Last Edit: 04 / February / 2020, 12:04:37 by pigeonhill »

*

Offline reyalp

  • ******
  • 14126
Re: Bracketing in continuous mode: subject distance
« Reply #9 on: 04 / February / 2020, 13:33:03 »
So without looking at the code beyond what you've posted, it seems like there's a few things going on
1) Bracketing values are updated in the raw hook, meaning that as soon as the Nth shot has been exposed and read out, the values are set for the (N+1)th shot.
2) Bracketing doesn't know how many shots are going to be shot, so the above also applies after the final shot.
3) Bracketing doesn't reset focus to the initial value after the sequence ends.

#1 is just how it works. Even if the overrides could theoretically be done at a different point, updating the capt seq code and testing > 180 cameras is not viable. Not a bug, won't be fixed. In script, if you need to read the values you have to know which side of the raw hook you are on, which can be done using the shooting hooks. The script raw hook runs before bracketing.

#2 cannot be fixed in the general case, because the number isn't known in advance in continuous mode, and at the point the hook runs, it's impossible to know if there will be another shot. It could be addressed in custom timer.
#3 Only applies in non-AF, since in AF the new shot will have a new starting point. Could potentially be addressed similar to ISO mode, but SD override is a fragile thing in the best of times.

One thing I've wanted for a while, semi-related to #2 and #3 is a "limit" option in bracketing, which would reset to the initial values once N brackets were shot. So you could hold the shutter down for a long sequence of +/- 1 ev shots, rather than going to extreme exposure values. The same logic could possibly be used with custom timer.
Don't forget what the H stands for.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal