subject distance: CAMERA_MIN_DIST & CAMERA_MAX_DIST - page 2 - General Discussion and Assistance - CHDK Forum

subject distance: CAMERA_MIN_DIST & CAMERA_MAX_DIST

  • 16 Replies
  • 4626 Views
*

Offline msl

  • *****
  • 1274
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: subject distance: CAMERA_MIN_DIST & CAMERA_MAX_DIST
« Reply #10 on: 12 / October / 2015, 06:00:59 »
Advertisements
Thanks for the investigations.

A differentiation of cameras with 16bit and 32bit values would be useful. An excessively high value should be no problem. Then will set infinity (-1). The camera can only set values which are also mechanically possible - see the propertycases for the subject distance.

msl
CHDK-DE:  CHDK-DE links

*

Offline srsa_4c

  • ******
  • 4396
Re: subject distance: CAMERA_MIN_DIST & CAMERA_MAX_DIST
« Reply #11 on: 14 / October / 2015, 17:48:59 »
I have done some research. Cameras newer than DryOS r23 all use 32bit integers for subject distance. So, if high SD values don't cause trouble, we could just modify include/camera.h to change the default high limit for r31 and newer cameras.

*

Offline srsa_4c

  • ******
  • 4396
Re: subject distance: CAMERA_MIN_DIST & CAMERA_MAX_DIST
« Reply #12 on: 29 / October / 2015, 20:55:43 »
Here's the proposed patch which changes the default CAMERA_MAX_DIST to 2000000 for DryOS r31 and higher. I had to reintroduce the CAM_DRYOS_2_3_R31 define for this.

*

Offline reyalp

  • ******
  • 13142
Re: subject distance: CAMERA_MIN_DIST & CAMERA_MAX_DIST
« Reply #13 on: 31 / October / 2015, 19:32:47 »
This looks good to me. Working on some tests to see the effect of using 2000000.
Don't forget what the H stands for.


*

Offline reyalp

  • ******
  • 13142
Re: subject distance: CAMERA_MIN_DIST & CAMERA_MAX_DIST
« Reply #14 on: 01 / November / 2015, 17:00:32 »
I did some testing D10, elph130 and sx160.

tl;dr
I don't think this change will make anything worse, and on cameras with long zoom should make sd override more likely to work at the long end.

SD override and behavior of SD related values (get_focus, propcases, exif) remains confusing and unpredictable.

D10 and elph130 previously had CAMERA_MAX_DIST defined, to 193273 and 775194 respectively. I removed these defines for testing. From what I remember, these values were obtained by using canon AF on a distant object and watching either a propcase or the DOF calculator SD value. I don't remember which (edit: might also have been the sdminmax script).

To test, I used the following approach (script attached):
Aim at a distant subject
set focus to some relatively close value ("Near" in the script).
half_press, wait for get_shooting, log values and release half press ("reset" line in the log)
set focus to distance to be tested
half_press, wait for get_shooting, log values and shoot ("set" line in the log)

The first set_focus is done to hopefully avoid the camera being coincidentally focused at a far distance, and verify that sd override is having some effect.
For each camera, I tested the previous max distance vs 2000000

For D10 and elph130, there was no visible difference between 2000000 and the previous max.

SX160 was in noticeably in better focus, which is unsurprising since the old limit was 64k, and it has a relatively long zoom.

All tests were done in MF mode using set_mf.

The logged values of get_focus(), PROPCASE_SUBJECT_DIST1 and PROPCASE_SUBJECT_DIST2 were somewhat confusing. The propcases are logged as 32 bit values using get_prop_str, since the default get_prop returns a short.

d10:
Code: [Select]
reset: 5000 get_focus=4997 p1=5038 p2=5038
set: 2000000 get_focus=20112 p1=-1 p2=-1

reset: 5000 get_focus=3980 p1=5038 p2=5038
set: 193273 get_focus=18095 p1=-1 p2=-1
The get_focus values are very different from the propcase values and set values.

elp130:
Code: [Select]
reset: 8000 get_focus=3123 p1=8053 p2=8053
set: 2000000 get_focus=162554 p1=-1 p2=-1

reset: 8000 get_focus=7560 p1=7976 p2=7976
set: 775194 get_focus=137126 p1=666667 p2=666667
get_focus values different again.

sx160
Code: [Select]
reset: 8000 get_focus=7914 p1=7996 p2=7996
set: 2000000 get_focus=-1 p1=-1 p2=-1

reset: 8000 get_focus=7914 p1=7996 p2=7996
set: 65535 get_focus=65320 p1=65402 p2=65402
This looks pretty much like expected behavior.
« Last Edit: 01 / November / 2015, 17:27:39 by reyalp »
Don't forget what the H stands for.

*

Offline reyalp

  • ******
  • 13142
Re: subject distance: CAMERA_MIN_DIST & CAMERA_MAX_DIST
« Reply #15 on: 07 / November / 2015, 19:12:12 »
I checked in the patch from srsa in reply 12. There may still be problems in the various focus related functions, but I don't think this will make them worse, and it should make things better in some cases.
Don't forget what the H stands for.

*

Offline msl

  • *****
  • 1274
  • A720 IS, SX220 HS 1.01a
    • CHDK-DE links
Re: subject distance: CAMERA_MIN_DIST & CAMERA_MAX_DIST
« Reply #16 on: 08 / November / 2015, 03:56:13 »
Thanks for doing this.

In addition I have removed some known redundant entries.

msl
CHDK-DE:  CHDK-DE links

 

Related Topics