Adjust RAW Exposure Measurement Area

Started by RenatoPhoto, October 14, 2013, 01:17:12 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

RenatoPhoto

The raw exposure calculations done by ETTR give erroneous numbers when using a Fisheye lens.  I have a 5D3 and an 8 mm fisheye which produce a circle image and a large black area around the image which ETTR is analyzing as if the black border was part of the image.  As a result the  Midtone SNR and the Shadow SNR will boost the exposure of the image above the required and correct levels.



Analyzing the image at the Canon crop of 3:2 5760x3840 we can inscribe a 3:2 rectangle inside the circle of 3170x2112

The crop factor would be 5760/3170 = 1.82

The same situation occurs with the fisheye and the 7D



Analyzing the image at the Canon crop of 3:2 5184x3456 we can inscribe a 3:2 rectangle inside the circle of 4506x3004

The crop factor would be 5184/4506 = 1.15

Also for my EFs 10-22 Canon on 5D3



Analyzing the image at the Canon crop of 3:2 5760x3840 we can inscribe a 3:2 rectangle inside the circle of 4062x

The crop factor would be 5760/4062 = 1.41

And yet another Tamron 17-50 on my 5D3



The crop factor would be 5760/3920 = 1.46

I assume that there will be other lenses so the option would be to have a user selectable crop factor or just pick some that could benefit all like:
1.2, 1.5, 2, 3

I put the 3 so that we could also measure the correct exposure for 5X cropped mode (equivalent to 3X crop factor).
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

Audionut

Quote from: RenatoPhoto on October 14, 2013, 01:17:12 AM
Also for my EFs 10-22 Canon on 5D3
And yet another Tamron 17-50 on my 5D3

Are you cropping these in post?
Why the APS-C lenses on a FF?

RenatoPhoto

Quote from: Audionut on October 14, 2013, 02:59:31 AM
Are you cropping these in post?
Of course.

Quote from: Audionut on October 14, 2013, 02:59:31 AM
Why the APS-C lenses on a FF?
Why not?  Not necessary to duplicate lenses, and I don't have money to waste.
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

a1ex


Audionut

Quote from: RenatoPhoto on October 14, 2013, 01:10:36 PM
Of course.

Try using the zoom on the lens instead.  Unless you're going for extreme aspect ratio in the center of the lens, the end result will be the same.

RenatoPhoto

Quote from: Audionut on October 14, 2013, 01:32:38 PM
Try using the zoom on the lens instead.  Unless you're going for extreme aspect ratio in the center of the lens, the end result will be the same.
Sometimes I use these in timelapses and want the full FOV so I can pan into the extra pixels area.
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

Greg


RenatoPhoto

Hi Alex,

I would like to spend some time trying to learn more about ML and this change is something that I am interested in digging a little further.

I was looking in ETTR.c and found some stuff but I am not sure if I am in the right track.

From the variable names it would seem that the exposure value comes from raw_to_ev but this seem to be a function that I could not even find the definition...

Then I found in raw.c some other stuff where you set width, height, skip_left, skip_right, skip_top which are pixels.  Here I am wondering if this could be used to redefine this borders so that the exposure calculations could be adapted to a specific crop size.

Anyway this is as far as I got and was wondering if you had any other suggested areas where I could explore the code to achieve these change.
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X

a1ex

raw_to_ev is in raw.c (transforms from linear raw values to log EV values). Scalar.

Width and height are read-only (image buffer size - what Canon gives us). Skip values are optical black areas (not part of the image).

What you need here is a histogram computed from a cropped area (histogram.c), since ETTR does all the work from histogram analysis. Probably the most straightforward is to add a crop window (x,y,w,h) to raw_hist_get_percentile_levels.

RenatoPhoto

Quote from: a1ex on October 18, 2013, 07:07:11 PM
What you need here is a histogram computed from a cropped area (histogram.c), since ETTR does all the work from histogram analysis. Probably the most straightforward is to add a crop window (x,y,w,h) to raw_hist_get_percentile_levels.

Found it!  Ouuuchh much more complicated than I imagined! 
Thanks for the information provided and I am still far away from understanding this code.
http://www.pululahuahostal.com  |  EF 300 f/4, EF 100-400 L, EF 180 L, EF-S 10-22, Samyang 14mm, Sigma 28mm EX DG, Sigma 8mm 1:3.5 EX DG, EF 50mm 1:1.8 II, EF 1.4X II, Kenko C-AF 2X