Magic Lantern Forum

Developing Magic Lantern => Modules Development => Topic started by: pravdomil on July 20, 2013, 10:19:10 AM

Title: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on July 20, 2013, 10:19:10 AM
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.

(https://bitbucket.org/pravdomil/ml/downloads/autoexpo.png)

(https://bitbucket.org/pravdomil/ml/downloads/autoexpo2.png)

Instructions
Autoexpo is based on APEX system (https://en.wikipedia.org/wiki/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 (http://en.wikipedia.org/wiki/Exposure_value#Tabulated_exposure_values)
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 (https://builds.magiclantern.fm/) Source (https://bitbucket.org/hudson/magic-lantern/src/eb960b67af34330623eb350bb1895dcae7623d0b/modules/autoexpo)  Buy me a beer  :) (https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BCL2X3AFQBAP2&item_name=Auto%20exposure%20beer)


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
Title: Re: Auto exposure algorithm (auto iso, auto ae, 5D2 only)
Post by: a1ex on July 20, 2013, 11:07:26 AM
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 )
Title: Re: Auto exposure algorithm (auto iso, auto ae, 5D2 only)
Post by: pravdomil on July 20, 2013, 11:20:49 AM
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
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 21, 2013, 12:21:59 AM
Yes...
(https://bitbucket.org/pravdomil/ml/downloads/autoexpo%20menu.png)
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: Andy600 on July 21, 2013, 05:15:54 PM
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?

Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 21, 2013, 06:23:12 PM
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)
(https://bitbucket.org/pravdomil/ml/downloads/expo_comp1.png)
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: xNiNELiVES on July 21, 2013, 06:53:26 PM
So this allows us to set a minimum shutter value?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: Andy600 on July 21, 2013, 06:54:50 PM
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

Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 21, 2013, 07:34:45 PM
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.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: xNiNELiVES on July 21, 2013, 07:46:24 PM
I'll test... Installing now.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: 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.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: xNiNELiVES on July 21, 2013, 08:06:54 PM
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?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 21, 2013, 08:46:24 PM
no its still buggy, I did only cosmetics changes
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 22, 2013, 06:52:23 AM
Next release.  This can be usable for shooting.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 24, 2013, 02:52:13 AM
Lock ISO & AV implemented, bugs fixed, look above.
Please test and port it!
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: xNiNELiVES on July 24, 2013, 02:55:39 AM
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?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 24, 2013, 03:06:14 AM
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?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: xNiNELiVES on July 24, 2013, 03:10:41 AM
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.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 24, 2013, 03:21:54 AM
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?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: xNiNELiVES on July 24, 2013, 03:38:44 AM
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.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 24, 2013, 03:54:42 AM
set tv minimum to 1/80 thats the solution or not? and you can modify graph as you want?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: xNiNELiVES on July 24, 2013, 04:03:25 AM
Ok let test this for a sec then.

Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: xNiNELiVES on July 24, 2013, 04:28:04 AM
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.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 24, 2013, 04:35:46 AM
well this hack can run only in M mode, because only there this module can set all exposure values
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: xNiNELiVES on July 24, 2013, 04:47:49 AM
How can this pull request do it? Maybe it's code will be of use? https://bitbucket.org/hudson/magic-lantern/pull-request/124/ml-autoiso-module-some-small-changes-fix/diff

Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: pravdomil on July 24, 2013, 12:53:43 PM
I can do pull request, but I think that is too early? Or not?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, 5D2 only
Post by: Doyle4 on July 25, 2013, 10:19:27 PM
Used Auto Exposure today with a.d's new build, highly impressed!

Ill be honest and say i dont fully understand the options, if theres a walk through that be great, but so far every image has come out looking like the environment im shooting! good find and nice work!
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, need to be ported
Post by: pravdomil on July 26, 2013, 02:27:08 AM
Thanks for feedback. I added some explanation. Look at the first post.
I'm using it with uniWB and... well it's what I want for years.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, need to be ported
Post by: xNiNELiVES on July 26, 2013, 02:43:04 AM
Umm how do you merge code with bitbucket? I've just started compiling need help. I don't mean to highjack the thread, sorry.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, need to be ported
Post by: ShootingStars on July 26, 2013, 03:06:17 AM
I would love to see updates on this!
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: pravdomil on July 26, 2013, 02:03:37 PM
added 500D, 550D, 600D, 60D, 6D, EOSM experimental support
no no warranty, I didn't do any tests, I don't have them
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae, need to be ported
Post by: Doyle4 on July 26, 2013, 03:44:37 PM
Quote from: pravdomil on July 26, 2013, 02:27:08 AM
Thanks for feedback. I added some explanation. Look at the first post.
I'm using it with uniWB and... well it's what I want for years.

Thanks for the explanation guide!

Loving this feature so much man!! Thanks again! ;D


Update: Been testing the difference between Auto Exposure, Full Auto and P Mode, i have to say.... Auto Exposure wins, the difference between Auto Exposure and Full Auto is massive, P mode is like AE little brother, thinks hes right but still not there yet, Auto Exposure...Always looks great  ;D
Title: Re: Auto exposure algorithm for shooting - auto iso
Post by: pravdomil on July 26, 2013, 07:24:36 PM
and what setting do you use?
you can apend screenshot / autoexpo.cfg if you want

I really don't know why Canon implement such a weak ae functionality. Probably it will be same case like with the raw video.
Title: Re: Auto exposure algorithm for shooting - auto iso
Post by: Doyle4 on July 26, 2013, 07:47:21 PM
Quote from: pravdomil on July 26, 2013, 07:24:36 PM
and what setting do you use?
you can apend screenshot / autoexpo.cfg if you want

I really don't know why Canon implement such a weak ae functionality. Probably it will be same case like with the raw video.

TV Minimum: 1/88
AV range: f/2 - f/8 (change depending what im shooting)
AV curve: 14.0 - 1.0 EVpEV
ISO Range: 100 - 800 (be nice to have a setting that can choose iso 320, i find that to be cleaner than iso 100, theres a site that has tested the iso range and found that 100 iso is a software tweak of 320, how true that is i dont know)
ISO Cure: 2.5 - +1.0 EVpEV
Lock ISO&AV: Off

These are guess settings as still unsure what everything is, iv read the guide but taking a little time for me to process it, im not good with technical terms ill be honest, i just play around till i think it looks right lol.

I dont know how to post images im afraid, i thought it was a simple upload jobby but from what i can see i cant find an upload button.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: pravdomil on July 26, 2013, 08:05:59 PM
well iso 320 is a strange thing
yes, I also need more practise with it
is good to know some basic knowledge of APEX and Exposure values, it will help you a lot
there is no upload buttons you have to use some external image hosting
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: Doyle4 on July 26, 2013, 11:04:32 PM
Not a problem if 320 cant be achieved as the results so far are great.

Will look into the settings more when i can :)

And thanks, ill look for a hosting site next time.

what is autoexpo.mo? i see a.d has posted it?

Update: autoexpo.mo is the module  :)
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: Doyle4 on July 27, 2013, 12:32:19 AM
Some links that may help people with this, helped me a lil, need to do more reading.

http://en.wikipedia.org/wiki/Exposure_value
http://en.wikipedia.org/wiki/APEX_system
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: brapodam on July 27, 2013, 02:30:20 AM
I have a question: do you set the BV yourself or does the module do that for you? I have no idea how to compile ML, so I can't try it
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: Doyle4 on July 27, 2013, 09:58:03 AM
Im not still too sure dude,

What i did was turn off AE, used manual and pointed it around my garden and looked at what shutter speeds would be needed for different part of it by looking at the meter, i changed to AV mode and looked at what Canon thought was best for apertures, i then made sure the shutter speed had a few drops below just incase, and min and maxed the appature to lil more and less than AV was saying, Along way round it but its helped me kinda understand AE a lil better.

For 5Dmkii AE has been added into the 25th July build, other models im not too sure.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: pravdomil on July 27, 2013, 10:57:54 AM
BV value is computed from the current scene
look at the first post there is some new installation instructions
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: marekk on July 27, 2013, 11:12:13 AM
I think it works really nice on 60D.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: mihaii on July 27, 2013, 12:29:16 PM
Thank you very much, you bypassed the AUTO ISO problem 5D2 had ..
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: brapodam on July 27, 2013, 01:04:26 PM
Quote from: marekk on July 27, 2013, 11:12:13 AM
I think it works really nice on 60D.
Ditto on that. However I still need to spend some time with it first to understand how it works. I initially thought that you could just leave the minimum ISO at 100 and forget about it and just tweak the aperture range, max ISO and minimum shutter speed. I found that it was not the case, and that I had to increase the minimum ISO in low light situations before it would select a higher ISO for proper exposure, regardless of my max ISO setting. (Or am I doing it wrong?)
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: pravdomil on July 27, 2013, 01:08:36 PM
Quote from: brapodam on July 27, 2013, 01:04:26 PM
I had to increase the minimum ISO in low light situations before it would select a higher ISO for proper exposure, regardless of my max ISO setting. (Or am I doing it wrong?)

please please, read the whole help guide in the first post
this hack has configurable ISO curve, you can exatly set how the ISO will be increased
spend some time by reading some help
and default values fits to 5D2, which is fullframe
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: brapodam on July 27, 2013, 04:40:42 PM
Quote from: pravdomil on July 27, 2013, 01:08:36 PM
please please, read the whole help guide in the first post
this hack has configurable ISO curve, you can exatly set how the ISO will be increased
spend some time by reading some help
and default values fits to 5D2, which is fullframe
As I said, the problem is with me not fully understanding how the thing works, and not your code. I've already read the first post already but I still do not fully understand how this should work, though I have a better idea after playing around with it for a while.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: pravdomil on July 27, 2013, 04:47:16 PM
well do more practice
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: Doyle4 on July 27, 2013, 08:19:07 PM
Quote from: brapodam on July 27, 2013, 04:40:42 PM
As I said, the problem is with me not fully understanding how the thing works, and not your code. I've already read the first post already but I still do not fully understand how this should work, though I have a better idea after playing around with it for a while.

Set ISO to a manual number say 100 as you would normal, also see if auto ISO is on, if so do the first part this post, i know what your meaning as i had this problem, i think i had auto iso on, if auto iso dosnt make a difference then im not sure,
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: brapodam on July 28, 2013, 03:38:08 AM
Quote from: Doyle4 on July 27, 2013, 08:19:07 PM
Set ISO to a manual number say 100 as you would normal, also see if auto ISO is on, if so do the first part this post, i know what your meaning as i had this problem, i think i had auto iso on, if auto iso dosnt make a difference then im not sure,
I don't have ML auto ISO module though, and I didn't set ISO to auto from Canon menu.

Anyway, is there any way to use this as an aperture priority with auto ISO? There are many times where setting the aperture you want is more important than using the lowest ISO possible. For instance, in an indoor event where, say, you use a 24-70 f2.8 or 17-50 f2.8. You want to set the max aperture to 2.8 (or leave it at the default 1.4) to shoot normal shots, but for group shots, you don't want to use f2.8, and instead something like f5.6. If you dial in f5.6, the module just meters and sets it back to f2.8

Maybe a "link to canon shutter" like the auto ettr min. shutter speed setting can be implemented (except in this case, link the Canon aperture setting to max aperture)?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: Doyle4 on July 28, 2013, 10:43:52 AM
Quote from: brapodam on July 28, 2013, 03:38:08 AM
I don't have ML auto ISO module though, and I didn't set ISO to auto from Canon menu.

Anyway, is there any way to use this as an aperture priority with auto ISO? There are many times where setting the aperture you want is more important than using the lowest ISO possible. For instance, in an indoor event where, say, you use a 24-70 f2.8 or 17-50 f2.8. You want to set the max aperture to 2.8 (or leave it at the default 1.4) to shoot normal shots, but for group shots, you don't want to use f2.8, and instead something like f5.6. If you dial in f5.6, the module just meters and sets it back to f2.8

Maybe a "link to canon shutter" like the auto ettr min. shutter speed setting can be implemented (except in this case, link the Canon aperture setting to max aperture)?

What you are saying is what you ca do.. if for instance you want to do a group shot and you dont want 2.8 set the AV to from 5.6 to 16 for instance? This is quite a complex module.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: brapodam on July 28, 2013, 10:55:21 AM
Quote from: Doyle4 on July 28, 2013, 10:43:52 AM
What you are saying is what you ca do.. if for instance you want to do a group shot and you dont want 2.8 set the AV to from 5.6 to 16 for instance? This is quite a complex module.
Yes, but there's no fast way of doing it. If you can, say, control that setting with the rear dial, it would be significantly faster
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: pravdomil on July 28, 2013, 01:05:28 PM
what about main dial for min shutter speed and main dial for apeture or ISO range?
thanks Doyle4 for answers
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: a59192 on July 28, 2013, 02:17:37 PM
This feature is useful in 5D2 perfect! Thank Development (Test 500D does not work properly ... :'()
Title: Re: Auto exposure algorithm for shooting - auto iso
Post by: Marsu42 on July 28, 2013, 08:03:44 PM
Quote from: Doyle4 on July 26, 2013, 07:47:21 PM
be nice to have a setting that can choose iso 320, i find that to be cleaner than iso 100, theres a site that has tested the iso range and found that 100 iso is a software tweak of 320, how true that is i dont know

Ugh? Never heard of that, could you please post the source, hard to believe that offhand ...
Title: Re: Auto exposure algorithm for shooting - auto iso
Post by: Doyle4 on July 29, 2013, 02:55:23 AM
Quote from: Marsu42 on July 28, 2013, 08:03:44 PM
Ugh? Never heard of that, could you please post the source, hard to believe that offhand ...

Sure,

http://photocascadia.wordpress.com/2011/05/13/canon-eos-5d-mark-ii-iso-noise-test/

and

http://www.dxomark.com/index.php/Publications/DxOMark-Insights/Pushed-ISO-Let-s-make-it-clear
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: Doyle4 on July 29, 2013, 03:03:22 AM
Quote from: pravdomil on July 28, 2013, 01:05:28 PM
what about main dial for min shutter speed and main dial for apeture or ISO range?
thanks Doyle4 for answers

Im struggling to understand what brapodam is meaning to be honest (not in a nasty way at all) to me it sounds like you are wanting to work like either Tv or AV mode which i would recommend using for the quickness you are after and shoot in RAW, Auto exposure to me is a advanced Auto feature with manual adjustments. But like i say, i may not be understanding your post correctly so im sorry in advance if i am reading it wrong  :)
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: brapodam on July 30, 2013, 05:54:50 AM
Quote from: Doyle4 on July 29, 2013, 03:03:22 AM
Im struggling to understand what brapodam is meaning to be honest (not in a nasty way at all) to me it sounds like you are wanting to work like either Tv or AV mode which i would recommend using for the quickness you are after and shoot in RAW, Auto exposure to me is a advanced Auto feature with manual adjustments. But like i say, i may not be understanding your post correctly so im sorry in advance if i am reading it wrong  :)
What I was suggesting is to have a quick way to adjust the maximum aperture to suit one's DOF needs. DOF requirements can change from shot to shot (for instance when shooting events where you may want shallow DOF to isolate subjects, but a larger DOF for group shots), and right now it's not easy to do that quickly - you have to dive into menus.

However, I do recognise that this may not be the point of this module - the Auto ISO module by Marsu42, used in Aperture Priority mode may better achieve this requirement.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: xNiNELiVES on July 30, 2013, 07:07:38 AM
Quote from: brapodam on July 30, 2013, 05:54:50 AM
What I was suggesting is to have a quick way to adjust the maximum aperture to suit one's DOF needs. DOF requirements can change from shot to shot (for instance when shooting events where you may want shallow DOF to isolate subjects, but a larger DOF for group shots), and right now it's not easy to do that quickly - you have to dive into menus.

However, I do recognise that this may not be the point of this module - the Auto ISO module by Marsu42, used in Aperture Priority mode may better achieve this requirement.

Have you used it before?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: britom on July 30, 2013, 07:27:14 AM
wow this worked on my 7d, thanks!
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: brapodam on July 30, 2013, 08:49:23 AM
Quote from: xNiNELiVES on July 30, 2013, 07:07:38 AM
Have you used it before?
yes I've used it, and it works pretty well. However I have not had a chance to use it in a real world situation, I only did a short test at home
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: Doyle4 on July 30, 2013, 11:10:37 AM
Quote from: brapodam on July 30, 2013, 05:54:50 AM
What I was suggesting is to have a quick way to adjust the maximum aperture to suit one's DOF needs. DOF requirements can change from shot to shot (for instance when shooting events where you may want shallow DOF to isolate subjects, but a larger DOF for group shots), and right now it's not easy to do that quickly - you have to dive into menus.

However, I do recognise that this may not be the point of this module - the Auto ISO module by Marsu42, used in Aperture Priority mode may better achieve this requirement.

Gotcha ya! give it a dedicated button that could jump you into the settings.. nice idea.. thinking which button is spare.. haha
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: nanomad on July 31, 2013, 12:07:14 AM
Hi,
i'm trying to use the spy_ae module on the 650D but I'm a bit stuck. Your code depends on a magic memory location 0x173ec. How did you find it?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: xNiNELiVES on July 31, 2013, 01:44:20 AM
Quote from: brapodam on July 30, 2013, 08:49:23 AM
yes I've used it, and it works pretty well. However I have not had a chance to use it in a real world situation, I only did a short test at home

How could you use it? You compiled it yourself? I just don't understand why the author can't compile the thing and give a download link.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: brapodam on July 31, 2013, 01:56:34 AM
Quote from: xNiNELiVES on July 31, 2013, 01:44:20 AM
How could you use it? You compiled it yourself? I just don't understand why the author can't compile the thing and give a download link.
Yes I compiled it after he fixed the code. He said there was a typo which caused the errors we were facing while compiling. It depends on a few changes so I just cloned his entire source to build rather than trying to clone the main ML source and patching in his stuff. I don't pretend to know how to do that, so I just do it the easy way  :)
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: pravdomil on July 31, 2013, 02:12:05 AM
Quote from: nanomad on July 31, 2013, 12:07:14 AM
Hi, i'm trying to use the spy_ae module on the 650D but I'm a bit stuck. Your code depends on a magic memory location 0x173ec. How did you find it?

yes this is harder, well after all this will be faster:
set (P Av Tv) or get (M) your exposure compensation to 1EV, make sure that you have metering on and find in RAM

if(*(int16_t*)ADDR) == 2049) you have it!
or
if(*(int8_t*)ADDR) ==  (2049 - 1) * 8 / 2048) might be too (not sure, loot at other AE_VALUES)


good luck!

http://cdn.bitbucket.org/pravdomil/ml/downloads/expo_comp2.png

btw: please revert the forum notifications some how, topic rss is also welcome
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: xNiNELiVES on July 31, 2013, 02:56:25 AM
Quote from: brapodam on July 31, 2013, 01:56:34 AM
Yes I compiled it after he fixed the code. He said there was a typo which caused the errors we were facing while compiling. It depends on a few changes so I just cloned his entire source to build rather than trying to clone the main ML source and patching in his stuff. I don't pretend to know how to do that, so I just do it the easy way  :)

So it's not compilable right now? He said he's working on the code right now.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: 1% on July 31, 2013, 04:29:51 PM
I have to try your finder module as 6D ae value works in LV only. Have to check other cameras. What happens if there is one AE_value for LV and one for photo?

Everything does depend on that timer above... what is it?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: nanomad on July 31, 2013, 05:53:16 PM
As pravdomil said, a good search strategy using a custom memspy is:
- Set EC to +1EV in P mode
- Find memory locations with a value near 2049 that hold this value for a long time
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: 1% on July 31, 2013, 05:58:32 PM
Yea but that location is neither Expo Comp (which 5DII uses to calculate AE value) nor ae_value.. it is some timer. On 6D its giving me locations like 0xFF8.

I found it tweaking AE spy and starting around where LV ae_value is. It has 01 or 02 appended to end depending on being in a manual or auto mode. I'll try to find some others.

50D is OK in LV + photo.

Hehe, this is as good or better than P mode and much more flexible.
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: pravdomil on July 31, 2013, 09:19:28 PM
as I write - you can probably find AE_VALUE which will be
*(int8_t*)ADDR) =  8
or EXPO_COMP
*(int16_t*)ADDR) = 2049
But this is not sure, maybe you camera will reported it other way.
Well this is place for spy_ae and first you have to find some ae related value (halfshutter pressed might be a good start).
Then left spy ae to do his job.

Maybe the best will be connect some keys that control EC to spy_ae.

Quote from: 1% on July 31, 2013, 04:29:51 PM
Everything does depend on that timer above... what is it?
What timer?
Title: Re: Auto exposure algorithm for shooting - auto iso, auto ae
Post by: 1% on July 31, 2013, 09:38:51 PM
(*(int*)0x173ec) != 23) is some timer on 5DII.. half shutter pressed or metering active?

It ignores events if its not.. this is good, on other cameras there are a lot of values on the screen, have to filter them with frequency/limits/etc.

Most probably have ae_value right tho so not needed, 50D was. Expo comp is unnecessary as +4 and 01 or 02 is around 2048/2049, it only comes up momentarily in memory while metering. If you look at the current AE value memory: if it has 01 or 02 at the end it will probably work in photo mode.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 09, 2013, 10:00:36 AM
nanomad try this https://bitbucket.org/hudson/magic-lantern/pull-request/174/mem_spy-module
set setting - halshutter related on, look for int16, range of adress 0x0 - 0x20 000, changes 20 - 300
switch to M mode, turn on mem_spy, make sure that you have metering off (dont press halfshutter)
go to info screen, wait at least for 5s (during this time changed values become hide)
turn on metering (hold halfshutter) and 20x change you scene exposure (aim at bright scene, then on dark, then on bright...)
some vars will occur, watch them how react on scene brightness
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: RenatoPhoto on August 14, 2013, 04:28:57 PM
Interesting development.

I compiled the module and installed it in 5D3.  In the module all functions seem to change the variables as noted, so the scroll wheel functionality is operational. 

Question: Is this module functional (Automatic Exposure adjustment) for the 5D3?  I ran some tested but I did not see any changes to the image with or without the module.  I tested with ISO in auto and in manual, the camera was in M mode.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 14, 2013, 06:46:32 PM
not yet, bv value isn't found on 5D3

You can lend me your 5D3 and I will find it :)

see first updated post
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: RenatoPhoto on August 14, 2013, 08:31:00 PM
Quote from: pravdomil on August 14, 2013, 06:46:32 PM
You can lend me your 5D3 and I will find it :)

You will have to come to my lodge.  I live inside a crater near Quito Ecuador.
We can enjoy a beer with a view of the crater!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: RenatoPhoto on August 14, 2013, 09:03:14 PM
Quote from: pravdomil on August 09, 2013, 10:00:36 AM
nanomad try this https://bitbucket.org/hudson/magic-lantern/pull-request/174/mem_spy-module
set setting - halshutter related on, look for int16, range of adress 0x0 - 0x20 000, changes 20 - 300
switch to M mode, turn on mem_spy, make sure that you have metering off (dont press halfshutter)
go to info screen, wait at least for 5s (during this time changed values become hide)
turn on metering (hold halfshutter) and 20x change you scene exposure (aim at bright scene, then on dark, then on bright...)
some vars will occur, watch them how react on scene brightness

I can try this.  I compiled the mem_spy.mo and can run it. 

In settings I can select int16 2B
Then I turn on module ON and press the LV button to go to life View.
Get lots and lots of numbers

So if I understand right:
I need to aim at bright light and press the half shutter, then put cap on and press half shutter.
Now I keep doing this and look for a number that changes...

I can test this later to try to find which memory locations are changing.

How many memory locations should I find?  I assume that the mem locations are like 2d2cc?
Then there is two colums of numbers and a mem location, then two colums.

format is

mem     number    number    mem     number    number

Any idea of the magnitude of the numbers?.. I see small numbers and very large numbers.  Some change some do not.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 14, 2013, 09:04:16 PM
https://maps.google.com/maps?saddr=Prague,+Czech+Republic&daddr=Quito+Ecuador&hl=en&sll=37.0625,-95.677068&sspn=57.249013,73.652344&oq=Pragu&mra=ls&t=m&z=3
We could not calculate directions between Prague, Czech Republic and Quito Canton, Ecuador.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: RenatoPhoto on August 14, 2013, 09:08:56 PM
Quote from: pravdomil on August 14, 2013, 09:04:16 PM
https://maps.google.com/maps?saddr=Prague,+Czech+Republic&daddr=Quito+Ecuador&hl=en&sll=37.0625,-95.677068&sspn=57.249013,73.652344&oq=Pragu&mra=ls&t=m&z=3
We could not calculate directions between Prague, Czech Republic and Quito Canton, Ecuador.

Ha Ha ;D ;D

Faulty Code!  You have to take a plane, land in Quito and call me 0991914333.  I will come and pick you up!  Bring Alex and G3GGo with you too!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 14, 2013, 09:11:21 PM
Quote from: RenatoPhoto on August 14, 2013, 09:03:14 PM
Then I turn on module ON and press the LV button to go to life View.
no LV! How do you figure that?

Quote from: RenatoPhoto on August 14, 2013, 09:03:14 PM
I need to aim at bright light and press the half shutter, then put cap on and press half shutter.
turn mem_spy ON, wait 10s, hold halfshutter and watch what it changing, still hold halfshutter don't unpress it until you find correct value

Quote from: RenatoPhoto on August 14, 2013, 09:03:14 PM
How many memory locations should I find?  I assume that the mem locations are like 2d2cc?
as I said
Quote from: pravdomil
set setting - halshutter related on, look for int16, range of adress 0x0 - 0x20 000, changes 20 - 300

Quote from: RenatoPhoto on August 14, 2013, 09:03:14 PM
Then there is two colums of numbers and a mem location, then two colums.
addr TAB num of changes TAB value

good luck!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: RenatoPhoto on August 14, 2013, 09:15:53 PM
Ok, I am not a programer but can read numbers.  I am an engineer so I will look into this later, I have to go now to the airport to pick up Nanomad and Audionut and others...  Just kidding.  Bu I do have to go to airport to get customers.
Thanks
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 14, 2013, 09:48:14 PM
it's easy, you don't have to be a programmer

some detailed instructions
turn you camera on
set M mode
go to mem_spy settings in debug menu
set look for int16 (maybe int8), halshutter related on, range of adress 0x0 - 0x20 000, changes 20 - 300, other options should be turned off
turn mem_spy on
wait 10s and go to info screen (dont press halfshutter)
hold halfshutter until you find correct value
20x changes scene brightness
some variables will occur
look at the values in every third column how they react on scene brightness
if you have some suspicious, look at the exposure compensation and analyze what values have 0EV +1EV -1EV

if you will testing for long time some variables will hide, that's max 300 changes limit, in other word if you 300x changes you exposure our variable will hide (~ 2 changes in second on 5D2)

on 5D2 and 5D3
(https://bitbucket.org/pravdomil/ml/downloads/expo_comp1.png)
(https://bitbucket.org/pravdomil/ml/downloads/expo_comp2.png)
look at these images should get 1EV and your value 2049 or -1EV value 2047
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 14, 2013, 10:17:32 PM
Quote from: RenatoPhoto on August 14, 2013, 09:15:53 PM
I have to go now to the airport to pick up Nanomad and Audionout and others...
G3GGo is from Germany and A1ex I think form Romania (not sure), Nanomad from Italia, Audionut dont know
we should make some ML party and find BV value on 5D3!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: ed.jenner on August 14, 2013, 11:51:49 PM
For me this seems like the almost-perfect 'auto' shooting control.  It takes some playing with to figure out initially what settings are going to work for particular situations, so I imagine you will get a lot of 'how do I use this' from people that don't have the patience to play with it for a while after which it makes total sense.

Of course the first 30mins I tried to use it  I had 'Exposure Lock' on and that did all sorts of strange stuff.  Made me wonder if there is a protocol for ML modules not trampling/fighting on each other.  Might become more of an issue as people add more individual modules, even if we are supposed to be power-users and know what we are doing!

I also don't understand why someone would need it to work in anything by Manual mode because you can set both Av and ISO to a particular value (min=max) and have anything else change exactly as you specify.  I guess you can fix Shutter Speed if you specify the appropriate Av and ISO changes, but in any case I think the minimum is enough and what most people would want the options the way they are.

Now you did mention Exposure Compensation in the first post and I would love to see this because I'm nearly always shooting the 5DII at +1/3 to +1EC.  Without that I basically have to accept that I'm going to be under exposing up to a stop from where I want to be.   Even with changing light, if I'm in Av then I often just leave the EC at +1/3 or +2/3 (1/2 stop increments in EC would be just fine too).

With that and several hours of practice at moving the curves around, the only remaining issue is that it is almost as far removed from 'auto' as one could imagine (in the best way possible).  It's like a real 'P' where you actually program what you want the camera to do depending on the light.

With EC I'd shoot everything but landscapes (for which I use LV and M) using this module.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 15, 2013, 01:15:58 AM
Quote from: ed.jenner on August 14, 2013, 11:51:49 PM
For me this seems like the almost-perfect 'auto' shooting control.
It's like a real 'P' where you actually program what you want the camera to do depending on the light.
definitely, this is meant as perfect auto exposure algorithm
I never have to set my exposure

Quote from: ed.jenner on August 14, 2013, 11:51:49 PM
It takes some playing with to figure out initially what settings are going to work for particular situations, so I imagine you will get a lot of 'how do I use this' from people that don't have the patience to play with it for a while after which it makes total sense.
true, maybe some video tutorial where will be explained, basic of exposure, APEX system and finally Auto exposure module (curves, ranges, limits)
this is warning for people that don't understand what auto expo do, please play with it for weeks before asking

Quote from: ed.jenner on August 14, 2013, 11:51:49 PM
I also don't understand why someone would need it to work in anything by Manual mode
agree

Quote from: ed.jenner on August 14, 2013, 11:51:49 PM
Now you did mention Exposure Compensation in the first post and I would love to see this
I have already think of it and I have some idea
another case - I need shoot low light scenes underexposed as they are (it can be done by setting minimum shutter value, but it is not cleanest sollution)
so EC will be just next curve
I will add
    EC value (which will constantly decrease or increase EC curve)
    EC range (min - max)
    EC curve (at BV +/- EV per BV)

thanks for feedback
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: chris_overseas on August 15, 2013, 03:48:32 AM
I've been trying to track down the memory location on the 5D3. So far I've found:

0x268DC - changes when rolling the rear dial.
0x2E770 - changes when rolling the rear dial.
0x2E780 - changes with the scene's brightness. Values are between -7000 and +9000 or so.
0x2E7C0 - ranges between 250 and 500 or so. Doesn't seem to map to brightness directly but is somehow related.
0x323F8 - possible?
0x323EC - possible?

I tried copying the 5D2 code that's in consts.h and using the address 0x2E780 but that froze the screen (top LCD and camera buttons still worked, wouldn't take a photo). I was going to play further but my camera batteries all need charging and it's 2:30am. Will try some more tomorrow.

In the meantime, I have a couple of questions:
What range of values should I be looking for? Is -7000 to +9000 reasonable?
How do I know whether to look for an int16 or an int8? It seems the 5D2 is an int16 but all other Canon cameras are int8?
When I think I've found the right address, what exactly should I do to test it?

Apologies for my lack of understanding, I'm new to this.

One small bug I noticed in mem_spy. The call to bmp_fill() should take FONT_SIZE rather than a hard-coded 12 (I noticed this because I had to make the font bigger so I could read the output!).
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 15, 2013, 04:08:59 AM
Quote from: chris_overseas on August 15, 2013, 03:48:32 AM
0x2E780 - changes with the scene's brightness. Values are between -7000 and +9000 or so.

This one is 2049 at EC+1.

Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 15, 2013, 05:05:35 AM
Looks like I got it working on the 5D3.  I'll create a pull request shortly.
Camera freezes as chris_overseas notes above when "Lock ISO & AV" is set to off.

@pravdomil

Can we stop it using digital ISOs?  Confine it to ISO 100, 200, 400, 800, etc.

EC adjustment will be very handy. 

Also the ability to link maximum aperture to Canon menu (like shutter in AutoETTR).  This way I can lock aperture to f/2.8 most times (sharpest for lens and reasonable DOF), but the option to adjust aperture to f/1.4 for low light situations and have the ISO curve respond like so,

(https://dl.dropboxusercontent.com/u/34113196/ML/VRAM0.BMP)
(https://dl.dropboxusercontent.com/u/34113196/ML/VRAM1.BMP)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 15, 2013, 10:50:49 AM
you find it!
https://bitbucket.org/hudson/magic-lantern/pull-request/180/autoexpo-working-on-5d3/

Quote from: Audionut on August 15, 2013, 05:05:35 AM
Camera freezes as chris_overseas notes above when "Lock ISO & AV" is set to off.
will be fixed as soon as possible
I don't know what is not working

Quote from: Audionut on August 15, 2013, 05:05:35 AM
Can we stop it using digital ISOs?  Confine it to ISO 100, 200, 400, 800, etc.
not yet, I will add a option
for now you can use round values at eg. at 3 + 1 EVpBV (APEX theory)

Quote from: Audionut on August 15, 2013, 05:05:35 AM
EC adjustment will be very handy. 
I will add it

Quote from: Audionut on August 15, 2013, 05:05:35 AM
This way I can lock aperture to f/2.8 most times (sharpest for lens and reasonable DOF), but the option to adjust aperture to f/1.4 for low light situations
well this is in todo list, you want two point curve
(https://bitbucket.org/pravdomil/ml/downloads/av%20curve.png)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 15, 2013, 11:26:53 AM
Quote from: pravdomil on August 15, 2013, 10:50:49 AM
well this is in todo list, you want two point curve
(https://bitbucket.org/pravdomil/ml/downloads/av%20curve.png)

2 is good.  More is always better  ;D

Thanks.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Stedda on August 15, 2013, 11:36:47 AM
Sweet! Is it fully working on 5D3?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: RenatoPhoto on August 15, 2013, 02:54:38 PM
Quote from: chris_overseas on August 15, 2013, 03:48:32 AM
0x2E780 - changes with the scene's brightness. Values are between -7000 and +9000 or so.


Quote from: Audionut on August 15, 2013, 04:08:59 AM
This one is 2049 at EC+1.

Yes,  Confirmed at mem location: 0x2E780
EC=-1 get -2047
EC=0  get 0
EC=+1 get 2049
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 15, 2013, 03:02:38 PM
Quote from: RenatoPhoto on August 15, 2013, 02:54:38 PM
EC=0  get 0
it should be 1
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: 1% on August 15, 2013, 03:24:38 PM
QuoteCan we stop it using digital ISOs?  Confine it to ISO 100, 200, 400, 800, etc.

On 50D, except for 100 those are digital ISOs. I suspect 5DII(550D?500D?) may be similar.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 15, 2013, 04:06:12 PM
Quote from: 1% on August 15, 2013, 03:24:38 PM
On 50D, except for 100 those are digital ISOs. I suspect 5DII(550D?500D?) may be similar.

If 100 is analog, so is every multiple.  I'd say the registers are backwards for some reason on the 50d, if my memory of your dualISO work is true. 

In photo mode, the in camera digital manipulation is burned into the cr2.  You can observe the results with a raw analyzer.

I rambled about digital ISOs here (https://bitbucket.org/hudson/magic-lantern/commits/ab6343a9a0b32dcddead31b69d0f40aa96eee296).
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: RenatoPhoto on August 15, 2013, 06:05:20 PM
Quote from: pravdomil on August 15, 2013, 03:02:38 PM
it should be 1
Correct at EC=0 mem=1

mem_spy is a nice tool!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 15, 2013, 11:28:24 PM
Quote from: Audionut on August 15, 2013, 11:26:53 AM
2 is good.  More is always better  ;D
have you idea how it can be done? what menu gui
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 16, 2013, 12:08:05 AM
No. Perhaps it's best to leave it as a 2 point curve option.

It doesn't solve my need for quick user adjustment of maximum aperture though.  User should be able to control DOF while having the shutter/ISO curves respond accordingly.
And I guess the same for shutter control (not one I use except for minimum).  User adjusts shutter and other curves respond.
Either as an option in prefs in M mode, or automatically in Av/Tv modes.

No idea how to do that either, that's way above my pay grade.

Note:  line 317
help = "Use main dial for maximum and left & right for minimum."

Should read the opposite way,
help = "Use main dial for minimum and left & right for maximum."
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 16, 2013, 12:35:55 AM
Quote from: Audionut on August 16, 2013, 12:08:05 AM
User should be able to control DOF while having the shutter/ISO curves respond accordingly.
User adjusts shutter and other curves respond.
well this is very hard to implement, you have to define all dependencies, I don't really know how to do that
if you will do some research, some excel file with graphs, it can be our starting point
for now I don't care about DOF and shutter, I only use setting in the first post
I don't know if I should implement 2 point curve

Quote from: Audionut on August 16, 2013, 12:08:05 AM
Note:  line 317
Should read the opposite way,
thanks I will switch it
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: 1% on August 16, 2013, 04:07:39 AM
QuoteIf 100 is analog, so is every multiple.

Why? 100 is always like 00. It changes ISO registers on the intermediates not on the 100s. So the register is already changed at 1250 and is no different at 1600, etc. On other cameras ISO 160 is ISO 200 with gain turned down. Here the next change is ISO 320.

Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 16, 2013, 04:53:22 AM
Think photography stops.  Did you find the SHAD_GAIN register (a1ex pdf page 4)?

Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 16, 2013, 05:18:36 AM
@pravdomil

If you enable in Av/Tv modes, couldn't you apply the maths from a fixed (user set) aperture/shutter?

if mode = Av / get_aperture_from_canon
Something along those lines?

Shutter value should always be reduced first for (best) quality, before raising ISO, +1.0 EVpBV
In Tv, aperture value should always be reduced for (best) quality before ISO, -1.0 EVpBV.  In Tv mode have the user ability to set minimum aperture value (this will keep people happy).
http://forums.whirlpool.net.au/archive/1988678

Now I remember why I ditched Canon Av/Tv modes, Canon autoISO uses digital ISOs, even when custom function is full stop ISOs ffs.

edit:  Haven't had a chance to look at this yet, but here is a LV calculator.
http://www.pentaxforums.com/forums/photography-articles/88197-excel-2003-lv-light-value-calculator.html

re 2 point curve.  Maybe see what interest it receives before spending coding time.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 16, 2013, 11:59:18 AM
Quote from: Audionut on August 16, 2013, 05:18:36 AM
If you enable in Av/Tv modes, couldn't you apply the maths from a fixed (user set) aperture/shutter?
well we can't change aperture in TV and shutter in Av (fighting with Canon) !

definitely I left this idea until there will be some clear and realizable algorithm

now I have to fix 5D3 lag, add EC curve, round ISO values, maybe option to attach main dial and speed dial to some conf value
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: nanomad on August 17, 2013, 05:25:01 PM
Ported to the 650D! Working beautifully :D
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 17, 2013, 08:13:43 PM
nice, how do you found it? mem_spy?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: nanomad on August 17, 2013, 08:28:06 PM
Yes, and a bit of spare time (int16, 20.000 addresses at a time)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: TheUnkn0wn on August 17, 2013, 09:29:05 PM
How to get AE_VALUE the easy way

1. Search for "***** copyOlcDataToStorage DataSizeOver Group0"
2. Go to its definition (as seen below)

(http://puu.sh/4491m.png)

3. Look above it you will see a value, in the example its 0x367B4
4. Pointer to EXPO_COMP = 0x367B4+0x1C


#define EXPO_COMP (*(int16_t*)(0x367B4+0x1C))
#define AE_VALUE (EXPO_COMP-1) * 8 / 2048


Done. ;)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 17, 2013, 09:50:42 PM
nice and how do you find this?
Quote from: TheUnkn0wn on August 17, 2013, 09:29:05 PM
+0x1C
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: nanomad on August 17, 2013, 09:54:23 PM
Disassemble it and  you'll see it uses that struct offset. Now we need to map that struct as it seems fairly important
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 17, 2013, 09:59:09 PM
I want to find bright value for each sensor, but it seems that they are not stored nearby EXPO_COMP.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: nanomad on August 17, 2013, 10:16:18 PM
Get on IRC, I've got a few ideas :D
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: TheUnkn0wn on August 17, 2013, 11:48:31 PM
I didn't know there was an IRC channel  ???

What's the channel?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 18, 2013, 12:27:10 AM
#[email protected]
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 18, 2013, 11:37:05 PM
next update https://bitbucket.org/hudson/magic-lantern/pull-request/188/autoexpo-update/diff
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: 1% on August 19, 2013, 02:58:15 AM
Any point to finding expo comp in addition to AE Value? I think AE_Value itself can be found in a similar way.


Why #define AE_VALUE (EXPO_COMP-1) * 8 / 2048? All cameras have AE_VALUE that doesn't need this and matches the on screen meter.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 19, 2013, 03:41:39 AM
Having problems trying to compile with the latest changes.

magiclantern@magiclantern-VirtualBox:~/magic-lantern/modules$ make
make -C  ../modules/autoexpo
make[1]: Entering directory `/home/magiclantern/magic-lantern/modules/autoexpo'
[ CC       ]   autoexpo.o
[ MODULE   ]   autoexpo.mo
[ STRIP    ]   autoexpo.mo
[ EXPORTS  ]   autoexpo.sym
00000550 autoexpo_deinit
000006e4 autoexpo_keypress
00000708 autoexpo_init
[ DEPENDS  ]   autoexpo.dep
Will NOT load on:
    5D3 (advanced_mode)
Not checked (compile ML for these cameras first):
    100D, 1100D, 40D, 500D, 50D, 550D, 5D2, 5DC, 600D, 60D, 650D, 6D, 700D, 7D, EOSM
make[1]: *** [autoexpo.dep] Error 1
make[1]: Leaving directory `/home/magiclantern/magic-lantern/modules/autoexpo'
make: *** [autoexpo] Error 2
magiclantern@magiclantern-VirtualBox:~/magic-lantern/modules$


edit:  Got it working fine for 5D3
https://bitbucket.org/pravdomil/autoexpo-module/pull-request/1/fixes-for-5d3/diff

I know there was some discussion about this, but I can't remember where.  Shouldn't this,

static int get_ec(int bv){
    int offset = ec_off;
    if(lock_iso){
        int valid = RAW2AV(lens_info.raw_aperture_min) - av_min;
        if(valid > 0) offset += valid;
    }
    return COERCE(ec - (MIN(bv - offset, 0) * ec_step) / 10, ec_min, ec_max);
}


Be formatted like so?


static int get_ec(int bv)
{
    int offset = ec_off;
    if(lock_iso)
    {
        int valid = RAW2AV(lens_info.raw_aperture_min) - av_min;
        if(valid > 0) offset += valid;
    }
    return COERCE(ec - (MIN(bv - offset, 0) * ec_step) / 10, ec_min, ec_max);
}


Can you link EC to a scroll dial?
This way it can be adjusted on the fly rather then changing via menu.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 19, 2013, 07:41:32 AM
The EC curve is doing my head in.  It would be far simpler for the end user if there were just some basic conditions.

User selects EC+

Try to EC with shutter

if fail, try to EC with aperture

if fail, try to EC with ISO.


User selects EC-

Try to EC with ISO,

if fail, try to EC shutter,

if fail, try to EC with aperture



With EC linked to scroll wheel, user selects EC for entire EV range.
User can then make EC adjustments on the fly, rather then using some predetermined curve that has no respect for the dynamic range of the scene.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 19, 2013, 09:59:15 AM
Quote from: 1% on August 19, 2013, 02:58:15 AM
Any point to finding expo comp in addition to AE Value? I think AE_Value itself can be found in a similar way.
Why #define AE_VALUE (EXPO_COMP-1) * 8 / 2048? All cameras have AE_VALUE that doesn't need this and matches the on screen meter.
https://bitbucket.org/hudson/magic-lantern/pull-request/144/autoexpo-module/activity#comment-408042

Quote from: Audionut on August 19, 2013, 07:41:32 AM
The EC curve is doing my head in.  It would be far simpler for the end user if there were just some basic conditions.
well this implementation is for me easier, you can do it and send me pull request

Quote from: Audionut on August 19, 2013, 03:41:39 AM
Can you link EC to a scroll dial?
This way it can be adjusted on the fly rather then changing via menu.
in TODO list

Quote from: Audionut on August 19, 2013, 07:41:32 AM
User can then make EC adjustments on the fly, rather then using some predetermined curve that has no respect for the dynamic range of the scene.
well it will be completely fixed after we found all brightness sensors values
I have this idea there will be 3 choices
Image that you are shooting from your room throw window.
1. I don't want any overexposure (like ETTR) - I want to shoot something outside
2. Balanced over and underexposure - I want shoot something outside and inside
3. I want to shoot dark areas - I want shoot picture on wall near the window
or you can shoot with DualISO :)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 19, 2013, 10:27:15 AM
Quote from: pravdomil on August 19, 2013, 09:59:15 AM
well this implementation is for me easier, you can do it and send me pull request

I must have been doing something wrong before, or it was a result of my incorrect code changes, or both.  It makes more sense now.

Quote from: pravdomil on August 19, 2013, 09:59:15 AM
in TODO list

Cheers.  This will be very handy.

Quote from: pravdomil on August 19, 2013, 09:59:15 AM
well it will be completely fixed after we found all brightness sensors values
I have this idea there will be 3 choices
Image that you are shooting from your room throw window.
1. I don't want any overexposure (like ETTR) - I want to shoot something outside
2. Balanced over and underexposure - I want shoot something outside and inside
3. I want to shoot dark areas - I want shoot picture on wall near the window
or you can shoot with DualISO :)

To be honest, I think it's best to keep this module simply what it does best.
EC is the photographers control over middle exposure.  It allows the photographer to compensate for situations like you have described.

As soon as you only concern with highlight protection, you no longer care about "correct" exposure.  ETTR should remain separate.
But it's your module ;)

Thanks for your work.  This is dragging me back from full manual mode back to semi-auto :)

I have a test build for 5D3 here (https://www.dropbox.com/sh/xiksvwbehzmycq4/QbuV17WuE5)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 19, 2013, 10:44:24 AM
Quote from: Audionut on August 19, 2013, 10:27:15 AM
EC is the photographers control over middle exposure.  It allows the photographer to compensate for situations like you have described.
As soon as you only concern with highlight protection, you no longer care about "correct" exposure.  ETTR should remain separate.

Sure, it will be only a option, there will be possibility to shoot with middle range and custom EC.
Probably I will call it Auto EC :D
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 19, 2013, 11:56:00 AM
show graph option, custom menu drawing, large graph
https://bitbucket.org/pravdomil/autoexpo-module/commits/c475bd15b075566efe78f38007e8f74da81e675e
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: nanomad on August 19, 2013, 04:58:23 PM
Quote from: Audionut on August 19, 2013, 10:27:15 AM
EC is the photographers control over middle exposure.  It allows the photographer to compensate for situations like you have described.

Couldn't agree more. We need to come up with a name for the EC curve that explains its rationale
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: 1% on August 19, 2013, 05:15:41 PM
Real AE_VALUE has values like this: F301

F3 would be like -3 expo and 01/etc is whether manual or auto exposure is used. It is int8... value must be matching your calcuation since its working everywhere else and gets reasonably good expo.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 19, 2013, 05:38:10 PM
Quote from: nanomad on August 19, 2013, 04:58:23 PM
Couldn't agree more. We need to come up with a name for the EC curve that explains its rationale

Currently, you can only curve it to the Luminance Value.  This has no respect for dynamic range or other scene conditions. 

Scene luminance value alone does not determine dynamic range or the midtone point.  Both of which are the factors in a photographer determining a correct level of EC.  If a scene has a very large dynamic range, you might apply a small negative EC to capture the highlights.  You might also instead decide to apply a small positive EC, to bring skin tones from the shadows into a correct exposure without regard for the highlights.  Adjusting the midtone.

In scenes with very little dynamic range, you might (should) apply a positive EC to push the exposure to the right hand side of the histogram.

Again, both of these cases cannot be determined by the scene luminance value alone.  So to map EC to luminance does not make sense.

The only other name I can think of for EC, is midtone correction.  Effectively this is what it controls, even though we can use it to other advantages (ETTR).

edit:  If the white point can be found outside of LV, now we're talking :)  Automatic positive EC (ETTR) in low dynamic range scenes, all in realtime without LV!  That's pretty awesome.  I don't have to think about exposure, I can concentrate on composition for instance.

Also midtone/shadow priority in large dynamic range scenes.
Quote2. Balanced over and underexposure - I want shoot something outside and inside
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 20, 2013, 11:14:03 AM
Quote from: 1% on August 19, 2013, 05:15:41 PM
Real AE_VALUE has values like this: F301
F3 would be like -3 expo and 01/etc is whether manual or auto exposure is used. It is int8... value must be matching your calcuation since its working everywhere else and gets reasonably good expo.

could you send me some instruction how can I find it via Ida like TheUnkn0wn posted?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: nanomad on August 20, 2013, 12:10:21 PM
Easy enough. Correct AE_VALUE is just EXPO_COMP + 1 taken as int8_t (offset 0x1D instead of 0x1C)

E.g. on the 650D:

#define EXPO_COMP (*(int16_t*)0x366d4)
#define AE_VALUE (*(int8_t*)0x366d5)


EXPO COMP is now useless. 366D4 is another int8_t showing when metering is active in M mode
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 20, 2013, 12:53:25 PM
yes it works, but for me this is still black magic
https://bitbucket.org/hudson/magic-lantern/pull-request/190/ae_value-autoexpo
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: nanomad on August 20, 2013, 12:58:49 PM
Welcome to the world of reverse engineering, where half of the stuff is a wild guess.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 22, 2013, 04:36:34 AM
Quote from: pravdomil on August 16, 2013, 11:59:18 AM
well we can't change aperture in TV and shutter in Av (fighting with Canon) !

definitely I left this idea until there will be some clear and realizable algorithm

So we should stay in M mode and allow user to define Av or Tv useability in module.
In Av useability mode.  Map max Av to top scroll wheel.
If max Av change, adjust ISO to match original curve.  We adjust ISO, because we always want to use lowest Tv (with respect for user defined minimum Tv) for maximum light through lens.  We don't adjust Tv, because like real Av mode, we let Tv float (based on Av/ISO) for correct exposure. 

Like so,
(https://dl.dropboxusercontent.com/u/34113196/Camera%20stuff/AE/VRAM1.BMP)
(https://dl.dropboxusercontent.com/u/34113196/Camera%20stuff/AE/VRAM0.BMP)

For Tv mode.  Map TV minimum to top scroll wheel.  Adjust ISO curve to match original curve.
(https://dl.dropboxusercontent.com/u/34113196/Camera%20stuff/AE/VRAM2.BMP)

Or redefine module, with AV minimum and TV range/TV curve.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: xNiNELiVES on August 22, 2013, 05:43:42 AM
So now we can shoot in other modes than M? Last time I was here I was told that it only works in M, which didn't allow an auto shutter speed.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 22, 2013, 12:16:00 PM
Quote from: Audionut on August 22, 2013, 04:36:34 AM
In Av useability mode.  If max Av change, adjust ISO to match original curve.
you probably mean min AV
so if you increase min AV => move ISO curve left

Quote from: Audionut on August 22, 2013, 04:36:34 AM
For Tv mode.  Map TV minimum to top scroll wheel.  Adjust ISO curve to match original curve.
so if you increase TV minimum => move ISO curve left

right? some other dependencies?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 22, 2013, 02:00:23 PM
Quote from: pravdomil on August 22, 2013, 12:16:00 PM
you probably mean min AV

Yes sorry.  My mistake on the GUI also, I was thinking aperture opening, not Aperture Value.

Quote from: pravdomil on August 22, 2013, 12:16:00 PM
so if you increase min AV => move ISO curve left
so if you increase TV minimum => move ISO curve left

Correct.  Only when Av is adjusted via scroll wheel, so that current functionality remains exactly the same.
ie:  Enter module and adjust settings as is currently done, when Av changes via scroll wheel, ISO curves adjusts accordingly

Quote from: pravdomil on August 22, 2013, 12:16:00 PM
some other dependencies?

Not sure the best way to control this with cameras that only have 1 scroll wheel.  On cameras with dual wheels (5D3 etc), Av/Tv control can be on 1 wheel, with EC control on the other.

Mapping minimum Tv isn't a true Tv priority mode.  This would require a mode select option to choose Tv/Av priority.  In Tv priority, Tv minimum becoming Av minimum and AV range/Av curve becoming Tv range/Tv curve.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Karmaschinken on August 22, 2013, 08:39:40 PM
Hello, I don´t understand some things happening here. I have installed the todays nightly build to have a look what has happened to ML during the last month. When stumbling upon this new ETTR-module, something that is completely new for me, but I get the idea behind it, I was wondering, if my long desired  min-max ranges for AV/TV and ISO were realized meanwhile. When googeling that, I found stated in a thread, that the module ml_auto_iso was dropped because now there is ETTR. But here I see a thread that is talking about a "real P"-mode, which, looking at the curves and so on, seems to be fantastic. And I can´t see how ETTR replaces min-max-ranges or even curves for exposure values? I see you discussed ETTR vs. "real P", but I can´t see your final conclusion.

However, this module discussed here is not implemented yet, no? What do you think, will it be linked into ML, and if so, when? Thanks a lot! Martin...
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 22, 2013, 08:57:55 PM
ETTR exposes for the highlights, this exposes for the midtones.

Quote from: Karmaschinken on August 22, 2013, 08:39:40 PM
However, this module discussed here is not implemented yet, no? What do you think, will it be linked into ML, and if so, when? Thanks a lot! Martin...

Try reading the first post.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: psihodrill on August 22, 2013, 09:00:22 PM
I testing the Auto exposure on 60D But at want moment i get error on Cr2 file its make vertical lines,this error i get when i have large iso 5000 - 10000. When i turn off autoexpo module & changed iso its start work properly. JPG file: https://www.dropbox.com/s/wbmwdxmgl5pb3uc/_MG_2130.CR2_1.jpg CR2 file: https://www.dropbox.com/s/8b33t1x46ffwnda/_MG_2130.CR2
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Karmaschinken on August 22, 2013, 10:01:03 PM
Jesus! Incredible stuff! You are real heroes! Okay, today I´ll try to learn some curves! :-D Thanks a lot!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 23, 2013, 12:39:54 AM
https://bitbucket.org/hudson/magic-lantern/pull-request/196/autoexpo-update

Same TV curve
Compensate minimum aperture changes with ISO offset.
And EC changes with max aperture & EC offset & ISO offset.
for now, I don't know how to make relation between min shutter speed, we need to describe it more accurately (the best in C)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 23, 2013, 12:32:55 PM
Thanks Audionut for a big beer! This will be a little different beer than others.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Marsu42 on August 23, 2013, 05:00:35 PM
Quote from: pravdomil on August 23, 2013, 12:39:54 AM
https://bitbucket.org/hudson/magic-lantern/pull-request/196/autoexpo-update

Nice solution for the #define AE_VALUE !

One request: Could you please add the option to link the iso range to what is set in the Canon menu, i.e. max. value and on 6d/5d3 also min. value? Afaik this also is what the ettr module does and what the autoiso module did.

Imho it makes sense for any modules or ml function to at least to be able to honor these central settings when automatically choosing an iso range, so if the user sets some values he/she can be sure the camera doesn't go beyond this anywhere unless manually overridden with the iso button.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 23, 2013, 05:06:41 PM
Quote from: Marsu42 on August 23, 2013, 05:00:35 PM
Could you please add the option to link the iso range to what is set in the Canon menu, i.e. max. value and on 6d/5d3 also min. value?
5D2 doesn't have any auto ISO settings.
You can do a pull request to my repo for other cameras.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Marsu42 on August 23, 2013, 05:17:33 PM
Quote from: pravdomil on August 23, 2013, 05:06:41 PM
5D2 doesn't have any auto ISO settings. You can do a pull request to my repo for other cameras.

Ok, I'll probably do this once I finished the autoiso module :-p ... the main part here is you're not opposed to the idea so if anyone comes around to it you'll merge it. It's really just the menu option/logic, you can get the value with a global variable: "int max_iso = auto_iso_range & 0xFF".
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 23, 2013, 05:19:04 PM
Maybe a found out relations between our properties.
iso_min => ec_off & iso_off & av_max
av_min  => ec_off & iso_off
ec      => ec_off & iso_off & av_max
tv_min  => ec_off & iso_off

iso_max => ec_off & iso_off ??


:D agree?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 24, 2013, 04:18:53 AM
Quote from: pravdomil on August 23, 2013, 12:39:54 AM
Same TV curve
Compensate minimum aperture changes with ISO offset.
And EC changes with max aperture & EC offset & ISO offset.

Nice work.  It all works as expected.

Quote from: pravdomil on August 23, 2013, 12:39:54 AM
for know, I don't know how to make relation between min shutter speed, we need to describe it more accurately (the best in C)

As Tv minimum increases, decrease Av (for maximum light through lens).  Where compensation fails with Av, move ISO curve left.
As Tv minimum decreases, move ISO curve right (for least ISO noise).  Where compensation fails with ISO, increase Av.

I would also think it's a good idea to respect min Av set by user in AV range.

Quote from: pravdomil on August 23, 2013, 05:19:04 PM
Maybe a found out relations between our properties.

I don't understand.

Can you determine the max Av of a lens?  Currently with -EC, Av max doesn't respect lens limit.
With -EC, EC curve should increase (towards +/-0 EC) at high BV to respect Av max of lens.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 24, 2013, 01:28:34 PM
Quote from: Audionut on August 24, 2013, 04:18:53 AM
Can you determine the max Av of a lens?  Currently with -EC, Av max doesn't respect lens limit.
turn on lens AV

Same TV relations (it works both ways)
if you increase ISO min => move EC curve and ISO curve to the right, also decrease AV max
if you increase AV min  => move EC curve and ISO curve to the left
if you increase EC      => move EC curve and ISO curve to the left, also decrease AV max
if you increase ISO max => move EC curve and ISO curve to the left ??
if you increase TV min  => decrease AV to AV min if not possible move EC curve and ISO curve to the left ??


agree?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 24, 2013, 02:47:35 PM
If you increase ISO max ==> do not move curves.
Increasing ISO max extends low light capabilities for the same shutter/aperture settings.

Everything else looks sound.

Quote from: pravdomil on August 24, 2013, 01:28:34 PM
turn on lens AV

Request this on as default. 
Changing AV outside of lens capability should be the (advanced) option.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 24, 2013, 08:30:48 PM
next update https://bitbucket.org/hudson/magic-lantern/pull-request/196/autoexpo-update/commits

Quote from: Audionut on August 24, 2013, 02:47:35 PM
Request this on as default.
done default lens av = this lens

I have implemented min ISO & min AV & EC changes.
I tried to implement min TV relation but it doesn't make sense for me, could you please post some example?
Above that I want to have same TV on and set min TV without changing other variables.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: frogcement on August 25, 2013, 02:35:35 AM
is there a module for the 7d with the most recent changes or should i figure out how to build it?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 25, 2013, 04:10:17 AM
Quote from: frogcement on August 25, 2013, 02:35:35 AM
is there a module for the 7d with the most recent changes or should i figure out how to build it?

Here (https://www.dropbox.com/s/pr9rxt1z6kejrv0/autoexpo.mo).  You will probably need a recent build for the 7D for the module to work.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: arrinkiiii on August 25, 2013, 04:27:09 AM
It's working on the 7D
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: frogcement on August 25, 2013, 04:29:28 AM
Quote from: Audionut on August 25, 2013, 04:10:17 AM
Here (https://www.dropbox.com/s/pr9rxt1z6kejrv0/autoexpo.mo).  You will probably need a recent build for the 7D for the module to work.
I cant get it to load, im running 2013Aug20.7D203
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: frogcement on August 25, 2013, 04:31:12 AM
Quote from: arrinkiiii on August 25, 2013, 04:27:09 AM
It's working on the 7D
Could you post your ML directory && autoexec file somewhere i could download them? id appreciate it.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: arrinkiiii on August 25, 2013, 04:40:46 AM
Here you go my friend

https://www.dropbox.com/sh/9w5t3lcmgugo32g/Xmn6H066DY


The autoexpo.mo that are im ML folder i think is more older that the version that Audionut have put now.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: frogcement on August 25, 2013, 04:49:10 AM
Quote from: arrinkiiii on August 25, 2013, 04:40:46 AM
Here you go my friend

https://www.dropbox.com/sh/9w5t3lcmgugo32g/Xmn6H066DY


The autoexpo.mo that are im ML folder i think is more older that the version that Audionut have put now.
Thank you for such a quick reply arrinkiiii, and for your posting the stuff i needed, but unfortunately we have the same versions :(
but a thousand thanks for trying to help me i will remember this if i can ever help you in future..
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 25, 2013, 04:55:02 AM
Quote from: pravdomil on August 24, 2013, 08:30:48 PM
I tried to implement min TV relation but it doesn't make sense for me, could you please post some example?

(https://s15.postimg.cc/w2v68ikyj/VRAM0.png)
(https://s15.postimg.cc/79lm7wrob/VRAM1.png)
(https://s15.postimg.cc/b5yy3wkdn/VRAM2.png)

Respecting min Av set by user.  User set min Av so that lens doesn't become wide open where quality (sharpness) can suffer.
We can use option "Lock AV min".  ??
.help = "Lock AV min setting to avoid changes by TV min.",

Else, where min AV is not at minimum,
(https://s15.postimg.cc/5uxbhi1az/VRAM5.png)

Push AV min to lens AV min and adjust ISO curve as needed.
(https://s15.postimg.cc/gu58us9aj/VRAM6.png)

Quote from: pravdomil on August 24, 2013, 08:30:48 PM
Above that I want to have same TV on and set min TV without changing other variables.

UnLink curves from TV min ??
.help = "Adjust TV min without changing curves.",
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 25, 2013, 04:56:16 AM
Quote from: frogcement on August 25, 2013, 04:29:28 AM
I cant get it to load, im running 2013Aug20.7D203

My mistake.  I didn't link it to a 7D build and I can't make a 7D due to compile errors.  :(
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: arrinkiiii on August 25, 2013, 06:45:27 AM
Quote from: frogcement on August 25, 2013, 04:49:10 AM
Thank you for such a quick reply arrinkiiii, and for your posting the stuff i needed, but unfortunately we have the same versions :(
but a thousand thanks for trying to help me i will remember this if i can ever help you in future..

Anytime my friend.

But you can't put it to work/load the autoexpo.mo?  I have load it now. After load the module i go to expo tab in ML menu, scroll down and is there.

Didn't try this last version from Audionut... is this last version the audionut upload that you ca't load? And the oldest evrsion you can? (just for trying understand what happen)


@Audionut

Hi,
you can't make a 7D due to compile errors? But this compile errors is because it's for the 7D?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: frogcement on August 25, 2013, 07:26:22 AM
Quote from: arrinkiiii on August 25, 2013, 06:45:27 AM
Anytime my friend.

But you can't put it to work/load the autoexpo.mo?  I have load it now. After load the module i go to expo tab in ML menu, scroll down and is there.

Didn't try this last version from Audionut... is this last version the audionut upload that you ca't load? And the oldest evrsion you can? (just for trying understand what happen)


@Audionut

Hi,
you can't make a 7D due to compile errors? But this compile errors is because it's for the 7D?
I'm sorry i didnt explain better, the version I have now is the same as the one you posted for me to download
and yes it works wonderfully, I was saying the version that audionut posted will not load for me, then he posted that
it wouldnt work as he couldnt compile for 7D. Im trying my own compile now,and unfortunately i am having to use the cygwin method as my linux box is down indefinitely. many thanks for your help anyway..
--
K.C. 
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: frogcement on August 25, 2013, 07:27:36 AM
Quote from: Audionut on August 25, 2013, 04:56:16 AM
My mistake.  I didn't link it to a 7D build and I can't make a 7D due to compile errors.  :(
Thanks audionut, im trying my own build, i doubt i'll have any luck but is worth a try.
--
K.C.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 25, 2013, 12:40:50 PM
@Audionut
I understand now, but I have no idea how to implemented in C yet

I'm waiting for merging with offic repo but devs have a vacation time?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: arrinkiiii on August 25, 2013, 01:40:12 PM
Quote from: frogcement on August 25, 2013, 07:26:22 AM
I'm sorry i didnt explain better, the version I have now is the same as the one you posted for me to download
and yes it works wonderfully, I was saying the version that audionut posted will not load for me, then he posted that
it wouldnt work as he couldnt compile for 7D. Im trying my own compile now,and unfortunately i am having to use the cygwin method as my linux box is down indefinitely. many thanks for your help anyway..
--
K.C.

Ask to britom  for compile, i think that he don't mind
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Marsu42 on August 25, 2013, 04:26:53 PM
Pravdomil, I've got a request that imho is important for action flash shooting, thus the long text (sorry :-)). I originally wanted to implement it in the autoiso module, but since your autoexpo now has ec on m and only in m can modify both shutter & iso imho it makes sense to implement it here and leave the autoiso module to good ol' Tv/Av.

As you know most likely know beyond a certain shutter value the camera goes to high speed sync mode if the speedlite supports it. This is often a problem because a) it draws more power, possibly maxing out the flash and b) it generates blur since hss is a continuous light rather than a burst, the latter lasts less than ~1/800s at full flash power.

As a consequence, the dumbest thing that can happen is to shoot a little faster than x-sync, for example 1/320s when the x-sync is 1/250s. You get a proper exposure alright, but with the bad side-effects written above. You can limit the shutter to max. x-sync in the Canon fw, but then the camera closes the aperture _ad_infinitum_ ... this request about making this behavior more flexible.

Request: a new option "X-Sync Delay" with +ev values in 1/3 stops that modify the curve. Up to max. x-sync + this value, stick to max. x-sync but close the aperture. Above this value, go back to the original aperture as it's hss now - this basically creates a "bump" in the curve.

Example if the bv rises, x-sync delay set to +1/3 with 1/250s x-sync (like on 60d):
... f5.6 @ 1/200
f5.6 @ 1/250
f6.3 @ 1/250 (instead of f5.6 @ 1/320)
f5.6 @ 1/500
f5.6 @ 1/640...

Implementation: 1. put camera-specific max. x-sync speeds into platform/const.h as #define
FASTEST_XSYNC_SPEED_RAW, 2. with the bv values modify ec to match the curve

With this and ec on m combined it's possible to shoot moving objects with flash in changing lighting conditions and still get the best possible result.

The reason just I don't do this myself is that I first wanted to discuss the idea and also see if you'd add it yourself since you're a much, much better programmer as I am and can implement these curve modifications while I'd probably fail at it :-o
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 25, 2013, 05:06:11 PM
Quote from: Marsu42 on August 25, 2013, 04:26:53 PM
I originally wanted to implement it in the autoiso module, but since your autoexpo now has ec on m and only in m can modify both shutter & iso imho it makes sense to implement it here and leave the autoiso module to good ol' Tv/Av.
Agree, autoiso by a1ex was experimental feature.

Quote from: Marsu42 on August 25, 2013, 04:26:53 PM
Pravdomil, I've got a request that imho is important for action flash shooting

I was shotting with flash more then 4 years ago, I have no flash now. And I prefer shooting without it.
Sorry, I will not be the one who does it.

Quote from: Marsu42 on August 25, 2013, 04:26:53 PM
The reason just I don't do this myself is that I first wanted to discuss the idea and also see if you'd add it yourself since you're a much, much better programmer as I am and can implement these curve modifications while I'd probably fail at it :-o
When I came to ML I don't know much about C, so try it, make pull req and I will give you some hints if I can.
Maybe some other dev will join 1%?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Marsu42 on August 25, 2013, 05:37:33 PM
Quote from: pravdomil on August 25, 2013, 05:06:11 PM
Agree, autoiso by a1ex was experimental feature.

Still, imho since it uses the traditional Av/Tv dial settings and is very clean, simple and accessible it's still bringing it back as a module as it basically backports the min. shutter setting from 6d/5d3.... not to put too fine a point on it: the options of your autoexpo are frightening if looked at the first time :-o
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Marsu42 on August 25, 2013, 10:43:30 PM
Yo, Pravdomil, I hope you don't mind me bombarding you with requests, but your autoexpo module and graph are really terrific and I see a lot of potential in this approach.

Today I had a good look at the module and tried shooting with it (again :-)) . Unfortunately, I cannot get it to do what I want it to do, and I even found the reason for it. Your module does great from a technical point of view to find the correct exposure within certain bounds/corrections by observing the parametric iso/aperture curve. However, from a photographic pov imho this leaves something to be desired:

My main issue here is the _linear_ aperture curve, no matter how I tweak it it goes to soon wider open (shallower dof than wanted & loss of sharpness), too soon closed too far (deeper dof & slower shutter than wanted) and/or too late closed (causing overexposure).

I don't know what you intend with the module, but what it in essence does is what all the "Creative Zone" dial settings from Canon do: implement some custom iso/shutter/av curve. Canon has a "black box" approach since you don't know what it does, and your parametric approach, even if tweaked to be non-linear might never be able to satisfy everyone.

But there is a solution: optional completely non-parametric, manual curves like the Canon digital back from the 90s allowed you to program. For each bv, let the user set what iso/shutter/aperture is wanted, and show the resulting curve plus the over/underexposure (i.e. the implicit ec) in the diagram.

If done with different profiles, everyone could program his favorite action/stills/macro/... curve and never worry about exposure again, well, unless Canon metering screws up and you have to shoot real m w/o autoexpo anyway.

The menu structure would be like this:
Bv value: ...
Shutter for this bv: ...
Aperture for this bv: ...
ISO for this bv: ...

Last not least, some "global ec" would be nice to shift this whole manual curve up or down if required. Btw this approach would also cover the problems with x-sync I described above. What do you (all) think?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 26, 2013, 02:27:42 AM
Quote from: Marsu42 on August 25, 2013, 10:43:30 PM
My main issue here is the _linear_ aperture curve, no matter how I tweak it it goes to soon wider open (shallower dof than wanted & loss of sharpness), too soon closed too far (deeper dof & slower shutter than wanted) and/or too late closed (causing overexposure).

This should be fixed once aperture is linked to a speed dial.  Then you can control DOF for the scene at hand and shutter/ISO will respond via the curves you have programmed.


Quote from: Marsu42 on August 25, 2013, 10:43:30 PM
Last not least, some "global ec" would be nice to shift this whole manual curve up or down if required. Btw this approach would also cover the problems with x-sync I described above. What do you (all) think?

There already is global EC.  And it also will be able to be linked to a scroll wheel and adjusted by the user on the fly.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Marsu42 on August 26, 2013, 09:03:13 AM
Quote from: Audionut on August 26, 2013, 02:27:42 AM
This should be fixed once aperture is linked to a speed dial.  Then you can control DOF for the scene at hand and shutter/ISO will respond via the curves you have programmed.

Sorry if I've been missing the "todo list"  and it's all in the queue, I'll happily keep observing the development - though I don't fully understand how manually changing the current dof for a scene would solve what I've described.

What I'd personally like is for the aperture curve to automatically remain at a "sweet" spot as long as possible, and only get modified at the both curve ends if the shutter or iso reach certain critical limits. However I tweaked it, the current linear approach doesn't seem to be able to do that because it's linear and the aperture gets constantly modified or has a cutoff value that is absolute evne if under/overexposure sets in.

Quote from: Audionut on August 26, 2013, 02:27:42 AM
There already is global EC.  And it also will be able to be linked to a scroll wheel and adjusted by the user on the fly.

I know, what I wrote was as the only option for a non-parametric curve plotted for the user. Btw good luck with tying some settings to the wheel, afaik nobody managed to link a function to this yet :-o
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 26, 2013, 09:29:44 AM
Quote from: Marsu42 on August 26, 2013, 09:03:13 AM
What I'd personally like is for the aperture curve to automatically remain at a "sweet" spot as long as possible, and only get modified at the both curve ends if the shutter or iso reach certain critical limits.

The left side of the curve (so to speak) is already controlled with EVpBV.  The right side could be controlled by,

if EC > -0.0
         lower min AV,

Quote from: Marsu42 on August 26, 2013, 09:03:13 AM
Btw good luck with tying some settings to the wheel, afaik nobody managed to link a function to this yet :-o

http://www.magiclantern.fm/forum/index.php?topic=7816.0
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 26, 2013, 09:57:29 AM
bad news
https://bitbucket.org/hudson/magic-lantern/commits/d34836ca7e44028ea7019cbff3a2ca5ae29f22cb
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Marsu42 on August 26, 2013, 10:09:08 AM
Quote from: Audionut on August 26, 2013, 09:29:44 AM
The right side could be controlled by if EC > -0.0 lower min AV,

Doh - am I missing something here? To me it seems the ec curve is independent from the av curve, i.e. ec doesn't lower min av as you just suggested? This is because the current autoexpo approach basically looks like a tweaked Av mode implemented in M, the main dependent variable is the shutter.

Quote from: pravdomil on August 26, 2013, 09:57:29 AM
bad news

I'm sure you and alex will find a way to resolve this, your autoexpo module is great, your menu approach with both wheels is a terrific contribution and you're really putting work into this!

Talking of that, another request: Please also mark the currently/last measured bv with a vertical bar in the graph so one can instantly see what the resulting av/tv/iso _right_now_ are w/o any further hassle :-)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Audionut on August 26, 2013, 10:16:23 AM
Look at this.

(https://s15.postimg.cc/5uxbhi1az/VRAM5.png)

EC +-0.

Notice how the EC curve falls to negative at low BV values.  Why?  Because current settings result in that amount of underexposure.

So map min AV to that EC curve.

Where EC > -0.0, reduce min AV to compensate.  This would result in EC curve remaining flat at lower BV with the AV min curve falling.

Isn't that what you want?  Reduce AV at lower BV to compensate? 
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on August 26, 2013, 09:33:32 PM
Quote from: Marsu42 on August 26, 2013, 10:09:08 AM
Talking of that, another request: Please also mark the currently/last measured bv with a vertical bar in the graph so one can instantly see what the resulting av/tv/iso _right_now_ are w/o any further hassle :-)
already done

I'm going to vacation, I will be left for 14 days. See later.

Btw here is the patched version:
https://bitbucket.org/pravdomil/magic-lantern-hack/commits/0352dd9cf59c8968f1a25727b878a1bd109218b5
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: 1% on August 29, 2013, 04:31:54 AM
btw: If you leave auto expo on and shoot some raw video... and have a camera that does the memory trick (6D/5DIII) autoexpo takes a reading while LV is closed/opened and what you're recording may be really off from what you wanted. it just ate what I was shooting (set iso 128K)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: RenatoPhoto on September 14, 2013, 08:49:20 PM
Camera 5D3, with yesterdays compile from unified.

Trying to learn how to use this but I ran into a problem.  Without changing anything the shutter speed is always very high and I dont know what to change to bring the shutter speed lower.

Specifically here is what the setup looks like and the shutter is always above 200 why?

(http://s20.postimg.org/ujmgy26ct/Auto_exp_Setup1.jpg)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on September 14, 2013, 10:55:27 PM
so your photos are underexposed?
there can be conflict with other features, not fixed yet
and what the graph looks like?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: RenatoPhoto on September 14, 2013, 11:30:32 PM
Quote from: pravdomil on September 14, 2013, 10:55:27 PM
so your photos are underexposed?

No, they look ok.  EC also works but the shutter is stubborn.

Quote from: pravdomil on September 14, 2013, 10:55:27 PM
and what the graph looks like?

(http://s20.postimg.org/f9r74m08d/Auto_exp_Graph.jpg)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: Marsu42 on September 15, 2013, 08:45:40 AM
Request: Autoexpo has EC on M and a great BV backend, but as far as I tried it cannot be easily used (yet) as a traditional M mode with Auto ISO that doesn't touch the pre-set shutter/aperture values, at least until the shutter or iso bounds are reached.

Also if autoexpo would have a straight "auto iso" option for M the problem with the camera stuck @iso400 with flash would be gone.

Would it possible to add this as an easy option? Nikon has it, or see here for a sample request: http://www.canonrumors.com/forum/index.php?topic=16973.msg313861
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on September 15, 2013, 06:32:26 PM
Quote from: RenatoPhoto on September 14, 2013, 11:30:32 PM
No, they look ok.  EC also works but the shutter is stubborn.
well could you try press shutter half way and remember what values it set, and goto the autoexpo menu and compare with values at the cyan linem, does it match?

Quote from: Marsu42 on September 15, 2013, 08:45:40 AM
Would it possible to add this as an easy option?
not now, my goal for now is finding a brightness sensors
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: RenatoPhoto on September 15, 2013, 06:55:39 PM
Quote from: pravdomil on September 15, 2013, 06:32:26 PM
well could you try press shutter half way and remember what values it set, and goto the autoexpo menu and compare with values at the cyan linem, does it match?
Yes it matches.

Now I see that the ISO curve can be displaced up or down and also the same can be done to the AV curve.  So by manipulating these curves I can bring the the shutter curve so that the shutter speed coincides with the brightness value at a lower setting.

I will analyze these curves to better understand how to use this algorithm.

Thanks
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: pravdomil on September 16, 2013, 08:07:09 PM
Quote from: RenatoPhoto on September 15, 2013, 06:55:39 PM
I will analyze these curves to better understand how to use this algorithm.
well now autoexpo is little complicated, this is a prototype, it will be simplified soon I hope
Title: Re: Auto exposure algorithm for shooting - auto iso, ae
Post by: dsManning on September 17, 2013, 12:18:28 AM
Love the work on this.  Some really incredible results.  I had a thought while testing Auto Exposure for a few minutes during a wedding I shot this past Saturday.

Would it be possible to program one of the 'lesser used' buttons (by my day to day use at least) like the DoF preview button, to quickly set 1 out of 3 (Shutter, Fstop, ISO) and have the other two variables 'auto expose' using the same projected graph, based off the 1 constant you set?

I'm sorry if that is confusing.  Best in camera scenario;

Settings are 1/125th shutter, 2.8-11 fstop, 100-800 ISO

Great for outdoors shadow to highlights.  Say for one shot I want to quickly take, I want to shoot as close as I can to f2.8.  My above convoluted question quickly summed up is, would it be possible to press the DoF preview button after you set fstop to 2.8 and have the auto exposure module recognize this and expose with a shallow DoF?

Thanks in advance.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Doyle4 on October 01, 2013, 05:26:06 PM
Hi there,

Been asked to post here as Autoexposure hasnt worked on 600D for awhile now, last time it worked was on TragicLantern NewMem, everynightly build i have tried it still dosnt, iv add the module from NewMem for 600D and the module is too old, any ideas?

When the module is loaded the shutter/aperture/iso constantly changed, now it does nothing and manual is still active.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on October 01, 2013, 06:27:33 PM
Quote from: Doyle4 on October 01, 2013, 05:26:06 PM
Autoexposure hasnt worked on 600D for awhile now
should work on 600D
http://nanomad.magiclantern.fm/jenkins/features.html
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: a1ex on October 01, 2013, 06:31:30 PM
That table shows what the compiler thinks it's working, not what's actually working ;)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on October 01, 2013, 06:35:19 PM
Quote from: dsManning on September 17, 2013, 12:18:28 AM
Would it be possible to program one of the 'lesser used' buttons (by my day to day use at least) like the DoF preview button, to quickly set 1 out of 3 (Shutter, Fstop, ISO) and have the other two variables 'auto expose' using the same projected graph, based off the 1 constant you set?
well this is most requested feature, firstly this has to be implemented: http://www.magiclantern.fm/forum/index.php?topic=7816
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Doyle4 on October 01, 2013, 07:02:14 PM
Still not functioning properly im afraid,

What happens now is: When loaded aperture is changed to f/16, shutter/iso stays same as when in full manual.
i also noticed when LV was active (AE does not work in LV as far as im aware) my camera screen showed shutter/aperture/iso change everytime i pressed shutter half way for a few seconds, sometimes pressing half way it wouldnt change any settings and overexpose.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on October 01, 2013, 08:07:30 PM
Quote from: Doyle4 on October 01, 2013, 07:02:14 PM
Still not functioning properly im afraid
conflict with ettr? or autoISO? don't know
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Doyle4 on October 01, 2013, 08:45:12 PM
ettr disabled, auto iso disabled. nothing, strange one  :-\ could the module be taken from newmem and made to work with latest nightly?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on October 01, 2013, 09:43:09 PM
Quote from: Doyle4 on October 01, 2013, 08:45:12 PM
could the module be taken from newmem and made to work with latest nightly?
what is newmem?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Doyle4 on October 01, 2013, 11:00:38 PM
Sorry about that, its the latest ML for 600D, TragicLantern 2.0 https://bitbucket.org/OtherOnePercent/tragic-lantern-2.0/downloads
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on October 01, 2013, 11:36:42 PM
Quote from: Doyle4 on October 01, 2013, 11:00:38 PM
Sorry about that, its the latest ML for 600D, TragicLantern 2.0 https://bitbucket.org/OtherOnePercent/tragic-lantern-2.0/downloads
well I don't support this fork and I don't have 600D, sorry
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Doyle4 on October 02, 2013, 12:34:31 AM
No problem,
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Marsu42 on October 03, 2013, 02:37:48 AM
Dear pravdomil,

I had a look at your module again and am actually very near using it for macro shooting ... but I have two requests / enhancements ideas:

1. Add a max. shutter speed option other than the cameras max. speed, for two reasons: a) I then can tie down the shutter speed to ranges where flash works better or to x-sync speeds, b) using the fastest possible shutter makes the shutter break sooner.

2. As it is, I cannot influence autoexpo except through the menu - for live shooting, this is often to slow. Please add options to modify the min. aperture and the min. shutter speed with the wheels on the camera so it allows for more and faster creativity...

... I imagine the dial turns should be easy to detect for the module since you know what you set through autoexpo, and when the user changes aperture/shutter not just reset it to autoexo values like not but also modify min. aperture/shutter at the same time in the direction the user specified.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Jakobmen on October 03, 2013, 01:32:55 PM
Nice
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on October 03, 2013, 02:35:06 PM
Quote from: Marsu42 on October 03, 2013, 02:37:48 AM
Add a max. shutter speed
Please add options to modify the min. aperture and the min. shutter speed with the wheels
I know I know, It's in TODO list. You can make pull request to autoexpo repo.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Marsu42 on October 03, 2013, 08:46:07 PM
Quote from: pravdomil on October 03, 2013, 02:35:06 PM
I know I know, It's in TODO list.

Sorry, I didn't want to pressure you, I didn't know that's what you meant by "wheel shortcuts" in your todo list. Feel free to add "max. shutter speed" to it though, you can really customize just about everything in the module, only this (for me) important setting is missing.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: djronbxs on October 10, 2013, 06:31:17 PM
should this be disabled when taking bracketed hdr photos ? also are there any best settings for the Canon 550D camera ?

thanks
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on October 11, 2013, 09:11:04 PM
Quote from: djronbxs on October 10, 2013, 06:31:17 PM
should this be disabled when taking bracketed hdr photos ?
these conflict is not yet handled, planned
Quote from: djronbxs on October 10, 2013, 06:31:17 PM
also are there any best settings for the Canon 550D camera ?
sorry don't have 550D
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: vertigopix on October 26, 2013, 05:20:57 PM
Hello pravdomil,

Can you tell me if i can use your module with a manual lens (Zenit Helios 44-2) ?
I have tried but bad results... (under exposure)

Maybe it's not done for this usage...  :-[

Thanks a lot !
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on October 26, 2013, 06:49:09 PM
it should work with manual lenses (with and without chip), but I didn't test it much
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: ShootingStars on October 28, 2013, 09:06:52 AM
Hi, I've been testing this... from my understanding...

THIS - Aims for fastest shutter possible by going to the lowest aperture and highest iso set. More for street/event photography.
AETTR - Aims for lowest noise possible by exposing for the brightest highlights, aims for lowest iso. More for landscape?

Sorry I am fairly new to auto expo.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on October 28, 2013, 09:14:23 AM
this aims for user define exposure curve for each BV value of scene
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: vertigopix on October 28, 2013, 09:42:42 AM
when I have time, I will experiment with a manual lens.
I hope this week !

But the question is what to configure for the aperture ?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on October 28, 2013, 10:08:05 PM
Quote from: vertigopix on October 28, 2013, 09:42:42 AM
But the question is what to configure for the aperture ?
just nothing, aperture settings will be bypassed I think
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: 1% on November 04, 2013, 12:09:19 AM
Ok, so I shot a bunch on 7D today. Is it possible to link autoexpo with ETTR? I find the first shot ETTR takes is often jacked and it takes 2 or so more to get a proper expo. It works faster with auto expo but then it overrides auto ettr. Amazingly things are coming out this way better than with ETTR alone.

So ie. autoexpo takes the 1st shot, ettr reads this and takes the next shot and then you have pretty much 0 wasted shots and correct initial exposure vs something dark or blown out. The 7D I have has no display in the viewfinder so its impossible to see what the initial exposure is and adjust it before ETTR.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: hjfilmspeed on November 04, 2013, 12:23:33 AM
Quote from: 1% on November 04, 2013, 12:09:19 AM
Ok, so I shot a bunch on 7D today. Is it possible to link autoexpo with ETTR? I find the first shot ETTR takes is often jacked and it takes 2 or so more to get a proper expo. It works faster with auto expo but then it overrides auto ettr. Amazingly things are coming out this way better than with ETTR alone.

So ie. autoexpo takes the 1st shot, ettr reads this and takes the next shot and then you have pretty much 0 wasted shots and correct initial exposure vs something dark or blown out. The 7D I have has no display in the viewfinder so its impossible to see what the initial exposure is and adjust it before ETTR.

Combining would be sick!!!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: RenatoPhoto on November 04, 2013, 12:57:28 AM
From my experience ETTR nails the exposure if the first exposure is a bit underexposed.  I was hopping to accomplish this by simply using Canon BV and lowering it by -1 EV as a starting point for ETTR.  If this can be done via autoexpo.mo link then it would be great but I wonder if it is necessary.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on November 04, 2013, 01:11:14 AM
the best sollution for this:
http://www.magiclantern.fm/forum/index.php?topic=8007.0
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Audionut on November 12, 2013, 07:40:27 PM
Quote from: 1% on November 04, 2013, 12:09:19 AM
So ie. autoexpo takes the 1st shot, ettr reads this and takes the next shot and then you have pretty much 0 wasted shots and correct initial exposure vs something dark or blown out.

This will fail on high DR scenes where the Canon meter will ignore the highlights (blow them) to get a midtone.
ETTR works very well when the initial exposure is under.  When it's over, it has to start guessing.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Marsu42 on November 13, 2013, 10:17:36 AM
@pravdomil:

I've re-implemented Av/Tv in M with your method in my auto_iso module which serves a different purpose than your autoexpo - your module is for 100% automatic exposure, mine is for semi-automatic and dumb EC on M. But metering should work the same way, so here are two questions:

* Metering sometimes fails, I cannot really pinpoint it yet (you're on 5d2, I'm on 60d/6d). I solved this by simply ignoring too high EC values beyond +-45, but I'm not really happy with this solution since this doesn't seem to be portable and I'm not really able to tell faulty metering from valid values. Any ideas? Obviously Canon indented the EC-metering display only as a nice feedback for the user, and not to be used by ML for actual metering...

* There is an inherent metering lag vs. plain Av/Tv since Canon sets the EC, then ML reads the EC and modifies the exposure. Did you try to speed this up with a high prio task that runs all the time? Your current task approach simply offloads some tiny calculations and is only run one, and when I tried the same thing I don't see any difference... but a continuous task might do better that is not triggered buy the usual module shoot task.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on November 13, 2013, 03:40:53 PM
Quote from: Marsu42 on November 13, 2013, 10:17:36 AM
* Metering sometimes fails, I cannot really pinpoint it yet (you're on 5d2, I'm on 60d/6d). I solved this by simply ignoring too high EC values beyond +-45
I didn't encountered this behavior. Autoexpo also fails?

Quote from: Marsu42 on November 13, 2013, 10:17:36 AM
* There is an inherent metering lag vs. plain Av/Tv since Canon sets the EC, then ML reads the EC and modifies the exposure.  Your current task approach simply offloads some tiny calculations and is only run one, and when I tried the same thing I don't see any difference... but a continuous task might do better that is not triggered buy the usual module shoot task.
Yes this is the biggest problem, autoexpo or any exposure algorithms based on AE_VALUE are one step after current exposure.
There is some Canon runtime that sets continuously the exposure (and changes AE_VALUE). Then ML detects the change and sets own exposure, but with delay around 60ms I think.

Quote from: Marsu42 on November 13, 2013, 10:17:36 AM
Did you try to speed this up with a high prio task that runs all the time?
It will no be perfect, since lens_set_rawaperture / iso / shutter functions takes some time and creates the delay.

The solution is finding raw values from brightness sensors.
http://www.magiclantern.fm/forum/index.php?topic=8007.0
https://bitbucket.org/hudson/magic-lantern/pull-request/193/debugger-module
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Marsu42 on November 13, 2013, 04:37:06 PM
Quote from: pravdomil on November 13, 2013, 03:40:53 PM
I didn't encountered this behavior. Autoexpo also fails?

I never really tried since I didn't manage to get the curves to do what I want :-p but I very much expect the same behavior since the bv code is equal - when I print the current AE value in LV, it works ok most of the sime, but then there are spikes of +-46 and some completely off any scale. Simply cutting off these spikes seems to work, but of course at the expense of an even larger lag.

Quote from: pravdomil on November 13, 2013, 03:40:53 PM
There is some Canon runtime that sets continuously the exposure (and changes AE_VALUE). Then ML detects the change and sets own exposure, but with delay around 60ms I think. The solution is finding raw values from brightness sensors.

I hope someone finds a way to directly access the Canon metering w/o AE_VALUE, until then it's likely I'll be sticking to Av/Tv modes since Canon metering ensures you've always got an ok exposure, while in M the delay can cause a mis-exposure if you're very unlucky and lighting suddenly changes

Quote from: pravdomil on November 13, 2013, 03:40:53 PM
It will no be perfect, since lens_set_rawaperture / iso / shutter functions takes some time and creates the delay.

Indeed, the question which lag is larger - the one because of Canon metering or of setting aperture/shutter...
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: engardeknave on November 13, 2013, 09:55:15 PM
Either of you interested in implementing spotmetering in LV? There is an actual spotmeter function, so I don't think it would be impossible to too difficult.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Marsu42 on November 13, 2013, 09:58:24 PM
Quote from: engardeknave on November 13, 2013, 09:55:15 PM
Either of you interested in implementing spotmetering in LV?

I never use lv for regular shooting, and if I want proper metering for tripod & focus stacking in lv I use auto-ettr (and dual_iso or bracketing)...
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Danne on November 14, 2013, 10:39:42 AM
Thanks Pravdomil for you,re very clever autoexpo module. Thanks to Marsu42 autoiso module I started looking for a solution to my needs when out shooting nature, birds and such. My main concern with canons automatic stuff is mainly the lowest shutter but also not being able to tweak the correlation between shutter and iso in av mode. The camera chooses whatever it thinks is best but sometimes a faster shutter is required , or slower for that matter. I believe these problems are solved with your module.
I did like this.

1 - set lowest shutter in Tv minimum
2 - set EC to specific situation
3 - start changing the ISO curve to change correlation between shutter and iso.(For now I just change the right EVpBV setting up or down)

It,s pretty fast to change while out shooting. A few buttons away from the "modified" shortcut menu.
WHat I would really like is being able to choose shortcuts to the "modified" menu myself.

Is it possible to have slowest shutter linked to the scrollwheel like you can in ettrmode or will this interfere with other things? Same question goes for changing EC and having it linked to the other wheel? Asked Marsu42 for this as well in his fine auto-iso module :).
Biggest thanks!
/D
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: StefanKeller.AC on November 20, 2013, 12:21:52 PM
Quote from: Marsu42 on November 13, 2013, 10:17:36 AM
I've re-implemented Av/Tv in M with your method in my auto_iso module which serves a different purpose than your autoexpo - your module is for 100% automatic exposure, mine is for semi-automatic and dumb EC on M.

this may fit better to me, where can I find/download it?

is it possible to read out focal length and adjust minimum Tv ??
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Marsu42 on November 20, 2013, 02:37:12 PM
Quote from: StefanKeller.AC on November 20, 2013, 12:21:52 PM
this may fit better to me, where can I find/download it?

http://www.magiclantern.fm/forum/index.php?topic=8688.0 ... repo is currently down, I'll re-upload it shortly - sorry for the delay, I'm currently more shooting & postprocessing than coding :-o

Quote from: StefanKeller.AC on November 20, 2013, 12:21:52 PM
is it possible to read out focal length and adjust minimum Tv ??

No, very, very unfortunately not so and I miss it a lot with my 70-300L ... ML can only read the focal length in live view, at least no one has managed to do otherwise even though obviously the Canon fw can. I'll add a feature request though:

http://www.magiclantern.fm/forum/index.php?topic=9367.new#new
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: StefanKeller.AC on November 20, 2013, 11:03:04 PM
thx. seems that I have to find out how to compile...
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Exile on November 21, 2013, 11:40:30 PM
I've been trying out autoexpo but i can't seem to get to change the aperture, it stays wide open(2.8 in my case) am i missing a setting? I read through this tread but can't find an answer.

Thanks in advance
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Danne on November 22, 2013, 12:57:54 PM
Try changing the AV curve
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on November 22, 2013, 04:29:47 PM
Quote from: Danne on November 22, 2013, 12:57:54 PM
Try changing the AV curve
thanks Danne
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Exile on November 22, 2013, 10:17:05 PM
Oke that changes it, alhough its 2.8 4.0 or 10.0, why can't it be changed with main dial as it would normally do in m mode?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Marsu42 on November 22, 2013, 10:30:43 PM
Quote from: Exile on November 22, 2013, 10:17:05 PM
Oke that changes it, alhough its 2.8 4.0 or 10.0, why can't it be changed with main dial as it would normally do in m mode?

You're mis-understanding the whole purpose of the autoexpo module: It is to expose completely *automatically* just like in P mode: auto!expo! ... the module just happens to be implemented in M because that's the only mode ML can set aperture & shutter at the same time. If you want semi-manual like Av/Tv look at the upcoming auto_iso module.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Exile on November 24, 2013, 09:05:08 PM
Ah oke, thanks for clearing that up.

Sounds like that is what i'm looking for, i would like to have a set shutter speed a variable aperture and depending on those 2 an as low as possible iso.
Canon already does this if i put auto iso on and put a minimum shutterspeed and shoot in aperture priority, but for some reason most of the time i get (much) higher shutterspeeds
then my minimum setting what leads to high iso setting which is not what i want.

Gues i misunderstood auto expo, sorry for noob question and i will be looking out for auto iso!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Exile on November 24, 2013, 09:10:31 PM
BTW

In what situation would you use auto expo?

You always have the desire for a sertend aperture or shutterspeed, or am I missing something?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: mgrant on February 17, 2014, 11:11:52 AM
I'm playing with this module on a 7D.  I'm using the version that made it into tragiclantern-v2.3.NEXT.2014Jan14.7D203.

Couple of things I noticed:

1) With the camera in Manual mode, the wheel on the back seems to alter the aperture as if this is Av mode while the module sets the shutter speed and ISO. 

2) If I put the camera in Av mode, the module only alters the shutter.  NOT THE ISO.

3) If I put the camera in Tv mode, the module only alters the aperture.  NOT THE ISO.

I wasn't expecting that about the ISO in 2 and 3.

In my mind, the wheel should adjust an offset of the BV.  It should let me push the scene darker or lighter.  For instance, if I were shooting in snow, I want to tell the camera that the scene is, in fact, very bright and hence to push the scene lighter (as if a lower BV).  If you use only the straight BV, it seems like you are always going to go towards a scene that is grey.  If you keep an internal variable and if the wheel is rotated say to the left, you increase the number in this variable and to the right you decrease it, then, you add this variable to the BV before setting based on the curves, shouldn't this do what I'm talking about?

I see talk above about using the main dial for shutter/aperture but I don't think I'd do this.  I'd use the dial near the trigger button for the shutter/aperture in Av/Tv mode only and use the main wheel on the back of the camera like I said above.

However, in Av and Tv mode, I do see the wheel on the back of the camera having some effect.  I can't tell if the Canon part of the firmware is taking that into account or if it's the module or both, but I do still see the module automatically trying to set the exposure or aperture.  Whatever is happening, it seems to almost be doing the right thing in those semi-automatic modes.

Where can I see the current BV of the scene that the camera is measuring?  I see some screen shots with the BV at the top of the info screen but I don't see that on m 7D when press the info button.  Is there some feature I need to enable to get that to appear somewhere?

Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on February 17, 2014, 07:14:53 PM
Quote from: mgrant on February 17, 2014, 11:11:52 AM
Where can I see the current BV of the scene that the camera is measuring?  I see some screen shots with the BV at the top of the info screen but I don't see that on m 7D when press the info button.  Is there some feature I need to enable to get that to appear somewhere?

last BV value of current scene is marked with the cyan line in the graph view
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: mgrant on February 18, 2014, 03:33:21 PM
I don't see what cyan line you're referring to.  I did find in Overlay -> Spot Meter, there is Spotmeter Unit which I can set to RAW (EV).  Is this the BV value based on the spot metering (extreme center point of scene)?

What do you think about my other comments about using the wheel to offset the BV that you use to calculate the aperture, shutter &iso?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on February 18, 2014, 04:33:31 PM
for displaying cyan line you have to press shutter halfway a then open the autoexpo menu (I'm not sure that it works with LV)

other comments make sense, there is a lot of things to do on autoexpo, the fastest way is do it by yourself :)
The first thing I have to do is repair my 5D2 (throwing err30).
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: PhotoCat on February 20, 2014, 09:07:31 AM
This is an amazing feature pravdomil!  Great work!

Wondering if it works with Canon spot metering as well? If so, is it possible to exposure lock on the spot meter? (with manual exposure compensation)

i.e.  lock exposure and recompose.

Thanks again for the great work!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: mgrant on February 20, 2014, 05:21:32 PM
I'm not 100% sure but it seems to take into account the Canon metering mode (as in spot metering). 

In my experimentation by setting the camera on a tripod and changing only the metering mode (In my 7D I have: Center-weighted, Evaluative, Partial, and Spot metering), I saw a consistent change in the numbers that this module choose. 

The BV Brightness Value that is used in the module seems to be the brightness of the scene as calculated by the Canon firmware.  Can anyone else confirm this?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: pravdomil on February 20, 2014, 09:10:19 PM
the AE value is based on exposure compensation in M mode, so autoexpo follows the metering mode
see also my answers to Marsu42 about the exposure delay a few pages back in this topic
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Marsu42 on March 03, 2014, 10:11:27 AM
Quote from: mgrant on February 20, 2014, 05:21:32 PM
The BV Brightness Value that is used in the module seems to be the brightness of the scene as calculated by the Canon firmware.  Can anyone else confirm this?

Indeed, and until someone discovers a direct access to the bv metering w/o reading ae these modules (autoexpo, auto_iso with ec in m) will only be "good enough" I'm afraid to say... it's really unfortunate given the work that has been put into these.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: brapodam on July 30, 2014, 02:49:45 PM
I'm not sure if I should post this here or under feature requests, but here goes...

Can a "link to Canon shutter" like the one in the ETTR module be implemented? I'm not sure if it has been suggested before (in fact I might have even suggested it previously but forgotten about it)

Basically if you turn the main dial it changes your Tv minimum value to that value, and if you turn the rear dial it changes your max aperture in the Av range.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: moonlite on September 27, 2014, 05:50:07 PM
is there any way to make this feature assignable to some button. i mean, that the m-mode would work normally until you press a button and then the automatic values kick in.

ps: i want it to be separate from the af / ae lock buttons (ie half-press and backbutton).
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: 2blackbar on December 25, 2014, 02:48:32 PM
IT works weird, why its picks ISO 800 and shutter 350 when it could be ISO 100 and shutter 60 ? I dont get it. IT should pick lowest ISO first then bump up shutter speed, im overexposed so why bumping up ISO o 350 ?
I kinda figured it ouy but how to leave that exposure so it wont go back to old one after releasing shutter button ? Id like yo use it for video.
Also on EOS M there is no wheel so its not possible to change all values, could you assingn them to something else on this particular model or just let us change values using only one button and arrows ?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: JonnyA on February 03, 2015, 10:14:10 PM
I use remote cameras to take day and night shots out in the field. For night shots I want the camera to select 30s shutter speeds. For some reason my Canon and Nikon bodies have trouble with this, in AV mode they select anywhere from 1-15s shutter speeds, even in total darkness.

I just installed ML on my 7D (latest night build) and hoped the autoexposure module could help me get the camera to select 30s shutter speeds at night. However I'm still getting 15-20s exposures. I have my autoexposure parameters as follows:

lens aperture: f/5.6
tv minimum: 32"
same TC curve: on
av range: f8-f8
iso range: 1600-1600
EC: 0

Any idea why I'm not getting the full 32" exposure when I'm taking pictures in a pitch dark room in my basement? I have the camera menu lights off, so don't think I'm getting stray light, got the viewfinder covered..

thanks a lot for any help
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Roland Deschain on April 14, 2015, 11:15:01 PM
Anybody have a working version of AutoExpo for the 700D? I'll donate for a copy of one... :)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Licaon_Kter on April 15, 2015, 12:20:23 AM

Quote from: Roland Deschain on April 14, 2015, 11:15:01 PMAnybody have a working version of AutoExpo for the 700D? I'll donate for a copy of one... :)
Is the version included in the latest nightly ( http://builds.magiclantern.fm/ ) not working for you?


What happens when you enable the autoexpo.mo module and restart?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Roland Deschain on April 15, 2015, 01:32:02 AM
I totally did not realize it was in the nightly. I was running a somewhat older version. Just updated, and it's there. Thanks a TON!

My bad.  :-[
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: boris on May 16, 2015, 08:34:03 PM
Hi Pravdomil,
This module seems great, but I can not get it to work on my 700D.
I installed the latest nightly, turned on the module, configured it, put the camera  in to M mode, half pressed the shutter button but in no lighting conditions see no change in the AV/TV/ISO...
Tried it both in LV and not...
What am I missing?

Thanks,
Boris
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: davidmarquesneves on July 18, 2015, 06:45:18 PM
This module is AWESOME, but the lack of AE LOCK is the unique feature that is missing.
Will be this possible?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Smolder on July 21, 2015, 08:42:52 AM
Hi all
would it be possible to change aperture range from f/1.1 to f/1.0  ?
Yes i have the Canon 50mm f/1.0 thats why. I know it is not a commen pice of glass but if it is an easy code change
id realy love to see that :)

Thank you.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Zodion on October 17, 2015, 05:42:12 PM
Hey,
i've got some questions/problems with autoexpo. I want to combine the autoexpo algorithm with the intervalometer from magic lantern.

I tried it on my Canon 550D but it did not work (haven't tried it on my 6D). Autoexpo itself works well, but only if I don't combine it with the intervalometer (which would be a killer-combination).

Are there some tricks or wasn't it planned to work with the intervalometer?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Walter Schulz on October 17, 2015, 06:07:18 PM
What exactly is the problem? Won't start? Stopping before sequence is completed? Exposure going wrong?
Please tell your ML version (date).
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: mothaibaphoto on October 17, 2015, 06:35:35 PM
Read the first post:
"Know issues
You have to press shutter halfway for a while"
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Delphino on December 08, 2015, 11:26:16 PM
QuoteHi Pravdomil,
This module seems great, but I can not get it to work on my 700D.
I installed the latest nightly, turned on the module, configured it, put the camera  in to M mode, half pressed the shutter button but in no lighting conditions see no change in the AV/TV/ISO...
Tried it both in LV and not...
What am I missing?

Thanks,
Boris

Same problem here. I tried it with newest release and updated firmware of 700D to 1.1.4. I tried with reset configuration, too. But nothing happens. How do we get it working on a 700D?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: derbestefan on December 20, 2015, 02:13:28 AM
Hi everybody,

is it possible to configure this module so that it sets the exposure according to focal length with zoom lenses, given the lens provides current focal length information?

I would really like to set it so that it sets the minimum exposure to at least double of current focal length but have not found a way to do so yet.

Greetings
derbestefan

OT:
By the way, am I blind or is there no button to subscribe to e-mail notifications from this topic?

Found this http://www.magiclantern.fm/forum/index.php?topic=9638 (http://www.magiclantern.fm/forum/index.php?topic=9638)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Odin on December 31, 2015, 12:48:59 PM
Can I use this in video mode?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: groundlessfears on December 18, 2016, 09:09:47 AM
where to download this for 5D3 using 1.2.3 firmware.? The dropbox link is empty
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Walter Schulz on December 18, 2016, 10:35:41 AM
It was merged into nightly builds long, long time ago.
Access Modules tab on your cam and activate it.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: xlc on January 01, 2017, 10:21:36 PM
Hello,

I have download this module for the 700D and it doesn't work.

Then I will instal cygwin and check out the code source and after read this post, see by debug that the AE_STATE is never set (always 0).
So I change the consts.h file for the 700D platform in replacement of the constants AE_STATE ans VALUE as written somewhere in a topic page after having check in hexa code. It will be then the following :

#define EXPO_COMP (*(int16_t*)(0x367B4+0x1C))
#define AE_VALUE (EXPO_COMP-1) * 8 / 2048
#define AE_STATE (*(int8_t*)(0x367B4+0x1C))

It works (I check by printing the values of ae, iso, and so on).

I can check in if you want.

Just a question, what it is the use of AE_STATE ?

Xav
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: juniata on January 05, 2017, 06:03:24 PM
Hi everybody!

Really sorry! I am new here, and this post seems to be writen in a larger context. It is difficult for me to completely understand it.

I am looking for an alternative firmware that will allow me to go above iso 400 in autoiso mode of my 5d mk ii. Also, it would be very nice to be able to set a range of exposure times, apertures and iso values in manual mode.

This post seems like the solution! But I cannot find the correct download link. Can somebody please help me to find this software?

Thank you so much!
Kat
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Audionut on January 08, 2017, 03:36:18 AM
This module is included in the nightly builds.  https://builds.magiclantern.fm/
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: alexw on February 10, 2017, 05:07:26 AM
I could have SWORN at one point I had my 70d configured with such an option that, in manual mode, I could hit a button and the exposure would snap to auto-settings. For example, I've got a scene properly exposed at iso 800, 1/250th, and f/1.8. The lighting changes, suddenly requiring 1/50th. Ideally, I go change sensitivity since I've got a few stops of headroom, but I don't have time just yet and want to "just get the shot" before I go chimping for optimal settings. I can just hit this magic button and the shutter speed will snap to 1/50th, and after seeing the properly exposed but blurry image, I can then go fix my settings. Does something like this exist in this module? Am I looking in the wrong place?

Case in point: I was shooting a concert, and leave my camera in M mode. I pick it up the next morning to get some snaps of a dog jumping on my friend, and all of them are way over exposed because I didn't have time to adjust settings. Sure, I could have switched to P, but I don't usually want to be there anyway. I'd rather have the reflexive workflow of auto button>(shoot?)>fine tune>shoot.

This is already kind of a thing in live view with this plugin - Half pressing the shutter auto sets exposure, but if you don't give the half press time, the shot uses the prior manual settings. But looking through the mirror, it's full auto all the time.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: seanruddy on April 04, 2017, 09:33:09 PM
noob here first post.
Thanks for all the amazing work!

2 feature ideas:
1 add is to ramp. A dropdown with 3 options sunset ramp and sunrise ramp no ramp.  Basically a one way  falling light or raising light.
If sunset is selected and it ramps up to 800 iso it does not skip back down to 400.  Or shutter jumping between 0.4 and 0.5. 

2 Also saving curve profiles would be sweet!

Again thanks for all the work that has gone into this project!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: dfort on July 02, 2017, 05:20:16 PM
The Autoexposure module is now working on the 700D:

https://bitbucket.org/hudson/magic-lantern/pull-requests/842/fixed-700d-ae-constants/diff

Also works with the 1.1.5 firmware update (http://www.magiclantern.fm/forum/index.php?topic=19831.msg186710#msg186710).
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: matija on September 20, 2017, 01:24:31 PM
Hi,

first of all, this module works on 1200D! That is really really great since it normally underexposes in low light.
Now, it does not work in Av mode, as far as I can see, seems by design. As an Av-in-most-situations shooter, I think it can easily be extended to do so.

Basically, if AV range (both limits) is set to Av value, the result is great. The benefit would be that it can be changed on a dial, without diving into ML menus.

So, as far as I can see, if (in Av mode only) these limits are set to Aperture value, thing would work like a charm! (Tv might be similar, at least as far as the lower limit is concerned)

Anyway, the module as is is one of the most helpful when it comes to stills. Now 1200D does what I wnat it to do better than 80D. Which reminds me...
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: almarsden on October 31, 2017, 11:46:32 PM
Hi all! Newbie here! :-)

Have just installed the latest nightly on my 5DII and when the Auto Exposure module is loaded the aperture, shutter speed and ISO are flickering all over the place, any ideas?

Thanks and keep up the amazing work ML Team!!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Audionut on November 01, 2017, 01:30:12 AM
I've answered at bitbucket (https://bitbucket.org/hudson/magic-lantern/issues/2806/flickering-aperture-shutter-speed-and-iso#comment-40928539).
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: almarsden on November 01, 2017, 09:25:15 AM
Cheers, found and responded.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: garry23 on February 04, 2018, 11:20:06 PM
I decided to give this module a go tonight, but after reading from the first post, and playing for hours with the settings and trying to correlate the curves, I must admit to be rather confused as to the use case.

Could someone who uses this module possibly give a few hints on the use case(s) and how to set things up.

Cheers

Garry
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: PtboPete on June 14, 2018, 05:22:43 PM
Curious, if I have auto exposure turned on and configured can I still use AETTR with or without dual ISO? I'm thinking one competes with the other.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: jerome_turmer on November 22, 2018, 04:23:56 PM
This sounds great!
Is there any way to restrict the maximum shutter speed to keep it below fash sync?
Thanks!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: scrax on April 21, 2019, 11:35:42 AM
Uhmmm, I was playng with it in those days and can't understand if it works or how is supposed to work...
ISO range works, seems.
But how to set Exposure compensation? Any change I made to EC range or curve seems to not having any effect (in LV, in photo mode nothing changes)
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Audionut on April 23, 2019, 01:59:34 AM
The changes aren't immediately visible in LV.  Requires half-shutter to see the exposure changes in LV.
Things work more smoothly in LV with 'Same TV curve' set to ON.  With Same TV curve set to OFF, I have to press half-shutter, release and press again fairly quickly, for the correct exposure settings to stick.

Quote from: garry23 on February 04, 2018, 11:20:06 PM
Could someone who uses this module possibly give a few hints on the use case(s) and how to set things up.

Missed this post earlier.

At the bottom of the module screen is Exposure Value. (https://en.wikipedia.org/wiki/Exposure_value#Tabulated_exposure_values)  You adjust all of the curves, so that at a specific exposure value as measured by the camera, the camera will use the exposure settings as set by the curves.

Look at this image from the OP.
(https://bitbucket.org/pravdomil/ml/downloads/autoexpo.png)

At EV 8, the camera will shoot ISO 100, 1/500, f/4.0.  You can adjust the curves so the the camera will use some other exposure settings at that EV.  Higher ISO, more narrow aperture, faster shutter, whatever.
In the above module settings image, the orange EC line is indicating underexposure at those current settings.

Here's another curve arrangement.
(https://bitbucket.org/repo/8b7b/images/1227553983-VRAM0.png)

At EV 8, the camera will shoot ISO 100, 1/4000, f/1.4

You basically use the module to tell the camera, at this EV, use these exposure settings.
Canons auto mode has some quirks.  And you're stuck with the exposure settings that Canon decides to use, only having EC to apply some changes to Canons auto mode.  This module is full customization of exposure settings that will be used.  Once you have the initial setup done (curve arrangement), then it works exactly like an auto mode.  Point and shoot!


Another nifty trick is being able to meter the scene.  Press half-shutter then enter the module.
(https://bitbucket.org/repo/8b7b/images/2706902367-VRAM1.png)

The blue vertical line shows the measured EV.
The above image is the same settings as the next image above, with EC +0.5 dialed in.  You can see the effect on the exposure settings.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: garry23 on April 23, 2019, 05:25:09 AM
@Audionut

Many thanks for the insight.

Cheers

Garry
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: scrax on April 23, 2019, 06:18:16 AM
Quote from: Audionut on April 23, 2019, 01:59:34 AM
The changes aren't immediately visible in LV.  Requires half-shutter to see the exposure changes in LV.
Things work more smoothly in LV with 'Same TV curve' set to ON.  With Same TV curve set to OFF, I have to press half-shutter, release and press again fairly quickly, for the correct exposure settings to stick.


Seems tha don't work for 600D. I've set ISO range from 200 to 800 in the module, then set M to 3200 ISO and it never changes, in LV or Photo mode still 3200 even if halfshutter pressed.
Same for aperture range set from f4 to f16, on camera f22 and it never changes.
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Walter Schulz on April 23, 2019, 09:25:47 AM
Expo override is off and it doesn't work outside LV, too?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: scrax on April 23, 2019, 09:36:43 AM
Quote from: Walter Schulz on April 23, 2019, 09:25:47 AM
Expo override is off and it doesn't work outside LV, too?

Yes to both.
Will try with exp. over. ON now and report back

I've disabled clear override with halfshutter and now I can see it change shutter and iso but not aperture (with exp. over. OFF), I suppose I'm doing something wron in setting up properly the module...

In photo mode i can't "change" shutter time or ISO (they are reset by the module as soon as I've changed them, so this is ok)

Only thing that don't change now is Aperture (set at f16).
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Walter Schulz on April 23, 2019, 09:54:31 AM
Just to be sure: You set ML to defaults before enabling autoexpo and haven't played around with Expo. Lock, ETTR ...?
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: scrax on April 23, 2019, 10:23:18 AM
Quote from: Walter Schulz on April 23, 2019, 09:54:31 AM
Just to be sure: You set ML to defaults before enabling autoexpo and haven't played around with Expo. Lock, ETTR ...?
I've tryed it on my usual config so yes played a lot  :P

Then backed it up and started with default settings (form ML and module too), works in LV but on photo mode not always (if I go to LV and back it start working in photo mode too, but if EV changes it keeps value for previous EV).

Need to make more test and find out if there is some setting that conflicts with it.

Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: jerome_turmer on May 15, 2019, 09:52:12 PM
It works great on my 6D. It would be great to be able to set a maximum speed for cases when you use flash and need to keep the speed below flash sync speed.

Thanks for all your work!

Bests!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: ncdog on October 25, 2020, 03:56:54 PM
The bitbucket link sadly doesnt work anymore. Anyone has a new link to download it ?
Would be really helpful to me!
Title: Re: Auto exposure algorithm for shooting - auto iso, ae (autoexpo.mo)
Post by: Audionut on October 26, 2020, 01:12:54 AM
Which links were you after specifically. The pre-compiled module is available in the main ML downloads, the source code has moved over to here: https://foss.heptapod.net/magic-lantern/magic-lantern/-/tree/branch/unified/modules/autoexpo