Scene Luminance - Script Writing - CHDK Forum

Scene Luminance

  • 4 Replies
  • 4459 Views
Scene Luminance
« on: 11 / March / 2013, 03:14:47 »
Advertisements
Hi,

Is there any way of getting at the Scene Luminance number available in the miscellaneous params directly from a Basic or Lua script?

Also does anyone know how the Bv96 number is derived? Are the Bv96 and scene luminance numbers independently presented by the camera or is some calculation being done by chdk using an assumed reflected light calibration constant?

I know I should be able to derive the luminance from the Bv96 value but being able to access directly from Basic or Lua would be easier.

A pointer to the relevant source code would be good.

thanks


Re: Scene Luminance
« Reply #1 on: 11 / March / 2013, 08:44:27 »
Is there any way of getting at the Scene Luminance number available in the miscellaneous params directly from a Basic or Lua script?
link> get_bv96() ?

or just get_prop(PROPCASE_BV) ?

Quote
Also does anyone know how the Bv96 number is derived?
Av+Tv=Bv+Sv
http://dougkerr.net/pumpkin/articles/APEX.pdf -  multiply APEX values by 96 to get APEX96 integer values

Note that you need to do the equivalent of a "half shutter press" for this values to be valid.  Something like :

Code: [Select]
press("shoot_half")
repeat
  sleep(50)
until get_shooting() == true
  release("shoot_half")
repeat
  sleep(50)
until get_shooting() == false
bv=get_bv96()
« Last Edit: 11 / March / 2013, 14:14:46 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Scene Luminance
« Reply #2 on: 11 / March / 2013, 17:31:01 »
Sorry, maybe I didn't make it clear.

I know how to get the Bv96 value.

I also know that I can convert it if I know the K factor.

What I was asking is related to the scene luminance number in candelas/m2 thats available in the miscellaneous values that can be displayed by OSD.

Is there any way of getting this value from a script without having to do the maths (ie L=KxNx2^(Bv96/96) where K is the manufacturers relective factor and N is the asa/iso constant).

I'm asking because I didn't think the math functions in Lua can cope??

Actually I just want to know where the code is that relates to scene luminance and Bv96 parameters.

Re: Scene Luminance
« Reply #3 on: 11 / March / 2013, 19:27:52 »
I'm asking because I didn't think the math functions in Lua can cope??
You might find this helps : http://chdk.wikia.com/wiki/Lua/Lua_Reference#Mathematical_functions_.28imath_library.29

Quote
Actually I just want to know where the code is that relates to scene luminance and Bv96 parameters.
trunk/core/shooting.c  -  line 259
Code: [Select]
int shooting_get_luminance() // http://en.wikipedia.org/wiki/APEX_system
{
    short bv = shooting_get_bv96();
    int b=(int)(100*k*pow(2.0,((double)(bv-168)/96.0)));
    return b;
}
http://trac.assembla.com/chdk/browser/trunk/core/shooting.c
« Last Edit: 11 / March / 2013, 19:36:50 by waterwingz »
Ported :   A1200    SD940   G10    Powershot N    G16

Re: Scene Luminance
« Reply #4 on: 11 / March / 2013, 21:20:29 »
Great, exactly what I was after.

thanks

 

Related Topics


SimplePortal © 2008-2014, SimplePortal