use of propcase MIN_AV when the camera inserts its ND filter - General Discussion and Assistance - CHDK Forum  

use of propcase MIN_AV when the camera inserts its ND filter

  • 5 Replies
  • 419 Views
use of propcase MIN_AV when the camera inserts its ND filter
« on: 02 / February / 2019, 14:35:28 »
Advertisements
Recently there were reported problems with the kap_uav.lua script producing very over-exposed images on an SX610 camera (no adjustable aperture - ND filter only). 

After some debugging, it looks like the images are over-exposed by about 3 f-stops, or about what you would get if the script expected the ND filter to be inserted when it calculated Tv, Av, and Sv setttings, but then failed to actually insert the ND filter when it took the shot.

Studying of the apex96 values used shows the following on a half-press for a brightly lit scene.

get_tv( ) = 895  ( 1/640 seconds )
get_av( ) = 382  ( f4.0 )
get_sv( ) = 380  ( ISO80 )
get_bv( ) = 881
get_prop(props.MIN_AV) =  664 (f11)

Calculating bv96 = tv96+av96-sv96 gives 899, close enough to the get_bv( ) value to be the same.

However, props.MIN_AV does not equal the get_av( ) value, indicating that the ND filter was inserted during the exposure calculation  (i.e. 382 ~= 664)

So to get the actual scene brightness, you must calculate bv96 = tv96+props.MIN_AV-sv96 (1179 in this case).    Using that value allows correct exposure when recalculating the desired Tv, Av, Sv, and ND filter state values.

In other words, the apex96 values reported when the ND filter is inserted do not take the presence of the ND filter into account. It's like an external ND filter was mounted over the lens without the camera firmware being aware it's there.

So given that this issue has not been reported after over 6000 downloads of the script, my question is whether the SX610 handles this differently than older "ND filter only" cameras.  I currently do not have access to my A1200 or SD940 so can't test this.  I've attached a test script that produces a log file. If someone would please run the script on an ND filter only camera and report back I would appreciate it.  Please point the camera at something very bright so that the ND filter engages.  The script prints a status message on the LCD when it runs telling you if the filter was inserted or not.

TIA.


Note : on a camera with an adjustable aperture, using bv96 = tv96+props.MIN_AV-sv96 will give the wrong brightness value. You need to use the original formula bv96 = tv96+av96-sv96 with the get_?v( ) values. AFAIK, those cameras will never use the ND filter to control exposure?

« Last Edit: 02 / February / 2019, 14:47:40 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online reyalp

  • ******
  • 12104
Re: use of propcase MIN_AV when the camera inserts its ND filter
« Reply #1 on: 02 / February / 2019, 19:01:31 »
Recently there were reported problems with the kap_uav.lua script producing very over-exposed images on an SX610 camera (no adjustable aperture - ND filter only). 

After some debugging, it looks like the images are over-exposed by about 3 f-stops, or about what you would get if the script expected the ND filter to be inserted when it calculated Tv, Av, and Sv setttings, but then failed to actually insert the ND filter when it took the shot.

Studying of the apex96 values used shows the following on a half-press for a brightly lit scene.

get_tv( ) = 895  ( 1/640 seconds )
get_av( ) = 382  ( f4.0 )
get_sv( ) = 380  ( ISO80 )
get_bv( ) = 881
get_prop(props.MIN_AV) =  664 (f11)

Calculating bv96 = tv96+av96-sv96 gives 899, close enough to the get_bv( ) value to be the same.

However, props.MIN_AV does not equal the get_av( ) value, indicating that the ND filter was inserted during the exposure calculation  (i.e. 382 ~= 664)
I strongly suspect something else is wrong with this port. MIN_AV should always be the *widest* possible aperture value, meaning <= to AV96 value. A propcase that changes value depending on the ND state is not MIN_AV, by definition.

My guess would be the propset is incorrect.

The sig finder says
// Guessed propset: 7, 9
and the camera is defined as 7.

edit:
In CHDK 1.5, you can get the ND value and state directly using get_nd_value_ev96() and get_nd_current_ev96(). These are detected by the sigfinder and independent of the propcase values.

ndtest.lua in the test directory can be used to determine if ND control works. I should have an updated version that checks the new functions soon.
« Last Edit: 02 / February / 2019, 19:06:38 by reyalp »
Don't forget what the H stands for.

Re: use of propcase MIN_AV when the camera inserts its ND filter
« Reply #2 on: 03 / February / 2019, 00:16:42 »
I strongly suspect something else is wrong with this port. MIN_AV should always be the *widest* possible aperture value, meaning <= to AV96 value. A propcase that changes value depending on the ND state is not MIN_AV, by definition.
It's frustrating not having access to my ND filter only cameras right now. 

It's also interesting that the get_tv, get_av, get_sv, get_bv values all seem mathematically correct.

@reyalp : On a fixed aperture camera, at the same zoom setting, would you expect get_av( ) to return a different value after a half_press where the camera decides to move the ND filter into place versus the value returned when it does not use the ND filter?

Quote
In CHDK 1.5, you can get the ND value and state directly using get_nd_value_ev96() and get_nd_current_ev96(). These are detected by the sigfinder and independent of the propcase values.  ndtest.lua in the test directory can be used to determine if ND control works. I should have an updated version that checks the new functions soon.
I'll add get_nd_value_ev96() and get_nd_current_ev96() to my little test script and ask the sx610 owner to test.   I'll also ask for an ndtest.lua trial.
Ported :   A1200    SD940   G10    Powershot N    G16

*

Online reyalp

  • ******
  • 12104
Re: use of propcase MIN_AV when the camera inserts its ND filter
« Reply #3 on: 03 / February / 2019, 00:28:06 »
@reyalp : On a fixed aperture camera, at the same zoom setting, would you expect get_av( ) to return a different value after a half_press where the camera decides to move the ND filter into place versus the value returned when it does not use the ND filter?
Yes. This was how I detected whether the canon firmware put in ND prior to finding the ND functions.

Using chkdptp on elph130

Aiming at a bright light, where I can hear the camera put in the ND:
Code: [Select]
con 3> =press'shoot_half' repeat sleep(10) until get_shooting() p=require'propcase' return get_prop(p.AV),get_prop(p.MIN_AV),get_nd_value_ev96(),get_nd_current_ev96()
4:return:647
4:return:371
4:return:276
4:return:276

Darker scene
Code: [Select]
con 4> =press'shoot_half' repeat sleep(10) until get_shooting() p=require'propcase' return get_prop(p.AV),get_prop(p.MIN_AV),get_nd_value_ev96(),get_nd_current_ev96()
5:return:371
5:return:371
5:return:276
5:return:0
Don't forget what the H stands for.


*

Online reyalp

  • ******
  • 12104
Re: use of propcase MIN_AV when the camera inserts its ND filter
« Reply #4 on: 03 / February / 2019, 01:17:44 »
My guess would be the propset is incorrect.

The sig finder says
// Guessed propset: 7, 9
and the camera is defined as 7.
Testing sx710, I found MIN_AV was incorrectly defined. I fixed it in r5155. MIN_AV is now 28 on both propset 7 and 9.

propset 7 was also originally defined incorrectly, I fixed it in r5073. So if your sx610 user is on an old build (or didn't update the lua files), that might explain the problem.
Don't forget what the H stands for.

Re: use of propcase MIN_AV when the camera inserts its ND filter
« Reply #5 on: 03 / February / 2019, 11:14:47 »
propset 7 was also originally defined incorrectly, I fixed it in r5073. So if your sx610 user is on an old build (or didn't update the lua files), that might explain the problem.
A wrong value for MIN_AV would explain the over exposure reported when using the script.   I'll suggest updating to the most recent build and retesting.  Thanks for the help with this - a bug in the script causing massive overexposure seemed unlikely give the number of people using it.

EDIT :  the sx610 is not available in the autobuild yet - I'll post a note on the porting thread with an updated build. Latest version available there was r4990
« Last Edit: 03 / February / 2019, 11:42:13 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

 

Related Topics