Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)

Started by pravdomil, July 20, 2013, 10:19:10 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pravdomil

I discover how to get brightness value so I implement new automatic exposure algorithm based on predefined curves.
It's like a real 'P' where you actually program what you want the camera to do depending on the light.





Instructions
Autoexpo is based on APEX system
Tv minimum
sets the minimum shutter value
Av range
sets aperture range, if it not match with current lens, it doesn't matter, it will be compensated with shutter
Av curve
by main dial you set point where will start aperture decreasing (in BV value)
speed dial sets how much will be aperture decreased, it sets the slope (minus EV per one BV)
ISO range
100 - 25600 make sure that you set correct ISO range (you can set this values via Canon ISO menu), otherwise you can get incorrect exposure. It also solves the 5D2 auto ISO bug, where is ISO hardcored to 400.
ISO curve
by main dial you set point where will start ISO increasing (in BV value)
speed dial sets how much will be ISO increased, it sets the slope (plus EV per one BV)
Graph
on the X axis is light (Brightness Value)
on Y is shutter (Time Value), aperture (Aperture Value), ISO (Speed Value) and EC (Exposure Compensation)
on the left you have bright scenes on the right dark
here is a few BV values you can get:
16   light sand or snow
16 - 13   daylight
13 - 8   cloudy, shade
8 - 1   Indoor
> 1   low light
-12   complete darkness
full list
graph shows what combinations will be used depending on light conditions (on BV)
last BV value of current scene is marked with the cyan line
shutter value is computed dynamically as BV - AV + SV - EC


Download Source  Buy me a beer  :)


Porting to other cameras
http://www.magiclantern.fm/forum/index.php?topic=7208.msg62915#msg62915
http://www.magiclantern.fm/forum/index.php?topic=7208.msg66952#msg66952

a1ex

Nice find!

I guess you want to find the luminance level of the scene, right?

Take the BV value from the expo menu (that is Av + Tv - ISO). When Bv is higher, the scene is brighter. Therefore, you should add the metered value to this.

That quantity would be the X axis on your graph (if you reverse it).

Theory: http://dougkerr.net/pumpkin/articles/APEX.pdf (mirror: http://acoutts.com/a1ex/APEX.pdf )

pravdomil

Yes, luminance level of the scene. This is planned for shooting.

I already computed the bv val, and it works nicely with about +/- 0,5 EV tolerance, it depends of c. fn I exposure increment settings.
int bv = APEX_AV(lens_info.raw_aperture) + APEX_TV(lens_info.raw_shutter) - APEX_SV(lens_info.iso_equiv_raw) + (EXPO_COMP / 256);

Thanks for docs, but understanding apex is not too hard, I want to do some "blending" between shutter and iso. I need some hint. Maybe I can create some public excel doc, where will be the equation.

Btw: expo_comp int works in all modes not only M


Andy600

Nice :)

I don't think I can test because I only have manual lenses but I've found possible addresses on the 50D using your spy_ae module (by changing Exposure comp value and looking what changes):

77b4
1c18
3028
3074
3b38
3078

Maybe 1% or GregoryOfManhatten can take a look?

Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

pravdomil

It works even if you unplug you lens (on 5D2)! Look at screen shot.
For better finding, here is what values it can acquire. (int16_t)

xNiNELiVES


Andy600

3074 and 3078 show AE overflow and ISO is locked at 100 or AUTO (manual lens).

The other addresses don't seem to do anything.

TBH I'm not sure how to test this or what settings to change in the module, or if the settings will do anything without a chipped lens

Colorist working with Davinci Resolve, Baselight, Nuke, After Effects & Premier Pro. Occasional Sunday afternoon DOP. Developer of Cinelog-C Colorspace Management and LUTs - www.cinelogdcp.com

pravdomil

Yes, this finding allows set all exposure setting dynamically.
I added minimum shutter option.
I don't know how to test it on other cameras without having it physically, send me you camera and I will implement it :).
For first release look above.

xNiNELiVES


pravdomil

Delete your module conf and download it now.
I have already test it, and it overexposures on bright scenes.

xNiNELiVES

Quote from: pravdomil on July 21, 2013, 07:49:13 PM
Delete your module conf and download it now.
I have already test it, and it overexposures on bright scenes.

Download a new module? The one you first uploaded was buggy?

pravdomil


pravdomil


pravdomil

Lock ISO & AV implemented, bugs fixed, look above.
Please test and port it!

xNiNELiVES

Well I tested. The thing is though I can only use this in Manual mode. Could you enable use in Av, Tv, P, or a Custom mode?

pravdomil

Override automatic exposure in P mode, it doesn't have a sense. We cannot block Canon automatic exposure for now.
BTW: what are the disadvantages in M mode?

xNiNELiVES

I'm looking to be able to set a minimum shutter speed for a custom shooting mode (C1,C2,C3). Selecting min and max ISO, and wether to decrease the shutter speed and compensate with ISO, or the opposite, would also be nice.

pravdomil

There was a discussion to attach different configs to custom modes.
But devs could not do it, because some there was some difficulties.
But I dont see any problems if custom modes will set to M.

How shutter speed compensation should work?

xNiNELiVES

How it will work? Well take this situation into account.

Say I'm shooting sunset with auto ISO and auto shutter speed. My settings in manual is 1/80 of a second my ISO is 800. Aperture value is irrelevant. The 5D mark II with auto ISO and auto shutterspeed would change the shutterspeed value to 1/30 or something lower, and the ISO to 200. I want for this module to make a cap on the shutter speed to he 1/80 so the ISO won't change to lower values. This minimum shutter speed setting is found in newer canon models such as the 6D, and 5D Mark III.

Basically the 5D mark II optimizes for lower ISO over a higher shutterspeed, I would like for it to be the opposite. This would be when the camera chooses a higher shutter speed over a lower ISO.

pravdomil

set tv minimum to 1/80 thats the solution or not? and you can modify graph as you want?

xNiNELiVES


xNiNELiVES

Ok well this works fine but I can't choose an auto shutter speed in Manual mode, which is the reason why I'd like this to work in AV mode.

pravdomil

well this hack can run only in M mode, because only there this module can set all exposure values

xNiNELiVES