DoF bug? - General Discussion and Assistance - CHDK Forum  

DoF bug?

  • 8 Replies
  • 2009 Views
DoF bug?
« on: 05 / January / 2019, 04:37:29 »
Advertisements
I’ve noticed a strangeness on my G7X that may be bug in the DoF feedback.


What happens is that the DoF feedback reports the wrong hyperfocal, until you do a half shutter press.


All other DoF info appears ok.


Or is it me not understanding the limitations ;-)

*

Offline reyalp

  • ******
  • 14080
Re: DoF bug?
« Reply #1 on: 05 / January / 2019, 17:41:12 »
I’ve noticed a strangeness on my G7X that may be bug in the DoF feedback.

What happens is that the DoF feedback reports the wrong hyperfocal, until you do a half shutter press.
Wrong in what way?

If you select one of the + options in the "Show DOF Calculator" it will attempt to color the values green when it thinks they are valid. The definition of valid is not entirely clear to me ???

The DOF calculator uses the *current* aperture for calculations (see here https://chdk.setepontos.com/index.php?topic=13508.msg138629#msg138629), so the value used outside of half press may vary from would be used in a shot, and it may also not properly account for CHDK overrides. I think this is probably a bug: It should probably use the propcase/override in half press, at least. But I'm not super familiar with that code.
Don't forget what the H stands for.

Re: DoF bug?
« Reply #2 on: 05 / January / 2019, 17:57:46 »
Seems to work as expected on my S95, ie when I go into Canon manual mode the hyperfocal is reported as expected and never changes unless I change focal length etc.

On the G7X the hyperfocal is not reported correctly until you do a half shutter press, then it remains fixed as expected, until focal length etc changes.

*

Offline reyalp

  • ******
  • 14080
Re: DoF bug?
« Reply #3 on: 05 / January / 2019, 19:01:02 »
On the G7X the hyperfocal is not reported correctly until you do a half shutter press, then it remains fixed as expected, until focal length etc changes.
How are you identifying "correct"? When it's reported incorrectly, what kind of value does it show? Something close, something totally random, -1?

Playing around with my G7 X, I get different (but relatively similar e.g 1.6 or 1.3) values after half pressing on different scenes without changing aperture or focal length, which definitely seems like a bug. I think we may be seeing the aperture used for AE/AF, rather than the set value.
Don't forget what the H stands for.


Re: DoF bug?
« Reply #4 on: 06 / January / 2019, 03:52:59 »
Reyalp
I 'know' what the hyperfocal should be from the Fl^2/(N.CoC) estimate.
Also I use TrueDoF-Pro ;-)
Just did some test with the following results:
  • Irrespective of FL or N, the H is incorrectly reported as 3.81 (always), until you do a half-shutter press (HSP), then it shows the 'correct' value.
  • If I don't do an HSP ans change FL, the H changes but is wrong and returns to the wrong H at the shortest (8.8mm) FL
  • If I do a HSP all is OK
  • If I change N, H does change
  • Same behaviour in M and Av modes
Hope this helps nail down the bug.
Cheers
Garry
« Last Edit: 06 / January / 2019, 03:55:21 by pigeonhill »

Re: DoF bug?
« Reply #5 on: 07 / January / 2019, 17:28:10 »
@reyalp

I've been looking into the 'DoF bug' and believe there is something going wrong on the G7X.
In macro mode, if I do a half press focus I appear to get the correct focus distance reported.
In normal mode, if I do a half shutter focus I get a very wrong focus distance reported, ie around a magnitude out.
On my S95 the macro and normal modes report the same distance, with the normal variances.

BTW where in the C code is the DoF stuff calculated so I may have a look at the source. Can you point me there.

Cheers
Garry



*

Offline msl

  • *****
  • 1280
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: DoF bug?
« Reply #6 on: 07 / January / 2019, 17:45:22 »
BTW where in the C code is the DoF stuff calculated so I may have a look at the source. Can you point me there.

https://app.assembla.com/spaces/chdk/subversion/source/HEAD/trunk/core/shooting.c

line 985 ff


msl
CHDK-DE:  CHDK-DE links

Re: DoF bug?
« Reply #7 on: 08 / January / 2019, 12:56:19 »
@msl and @reyalp

Thanks for the link, I had seen that chunk before, but hadn't realized the near DoF was there: silly me.

Looking at fixing the near DoF reporting, it seems to be a simple matter (well for those that compile, ie not me I'm afraid) to do this:

Replace lines 994/995:
Code: [Select]
  if (shooting_is_infinity_distance()) return (-1);
  int h_1e3 = shooting_get_hyperfocal_distance_1e3_f(av, fl);

 with

Code: [Select]
  int h_1e3 = shooting_get_hyperfocal_distance_1e3_f(av, fl);
  if (shooting_is_infinity_distance()) return (h_1e3/1000);

Assuming I've got things right ;-)
I may not meet scrutiny, as I noticed the code has lots of (repetitive) rounding, ie rounding of rounding, which I don't understand.

As for the other strangeness with G7X focus, I'm afraid I got nowhere looking at the code.

Cheers

Garry


Re: DoF bug?
« Reply #8 on: 14 / January / 2019, 16:35:52 »
Have continued to ‘investigate’ the DoF feedback on the G7X and have noticed that the aperture doesn’t  update until you do a half shutter press, ie the hyperfocal doesn’t update. But a focal length change does dynamically update the hyperfocal distance.

 

Related Topics