Dual ISO - massive dynamic range improvement (dual_iso.mo)

Started by a1ex, July 16, 2013, 06:33:50 PM

Previous topic - Next topic

0 Members and 3 Guests are viewing this topic.

awesnap

Quote from: ayshih on January 31, 2014, 05:48:29 PM
It's really doing ISO 400/1600.  You haven't specified what camera model you're using, but the available recovery ISOs are restricted depending on the particular model.  I know that my 50D tops out at ISO 1600.  The technical reason for this restriction is that Dual ISO is implemented by changing the CMOS-gain registers, while the ISOs greater than 1600 on the 50D have the same CMOS gain as ISO 1600 (a different amplifier gets you to the higher ISOs).

Ok thanks.  Yea sorry about that, I forgot.  I have a 5d mk2


Recently I decided to try this out when I was out for a party at a museum.  The dance floor was pretty much pitch black, so I decided to use a flash. I noticed during post afterward, when I load the files in Lightroom 5 and shooting people, I tend to take down the highlights, resulting in the skin gets VERY "sun-burned". More so than regular raw files (obviously, cause the highlight recovery is insanely effective now)....  Besides taking down the red/yellow/orange levels to try and compensate and recover the highlights, is there anything you guys would recommend to keep the "sun-burn" under control?

I'm loving this level of control of DR I have now, its so addicting to just shoot Dual Iso all the time!! Thank you again for this awesome tool!!

awesnap

Also, one other quick question I had.  When exposing for a Dual ISO shot, are you guys exposing for the base ISO, or the recover ISO, or somewhere in between?

a1ex

Expose to the right for ISO 100, then bump the recovery ISO to fill the shadows (400-1600, depending on how much contrast you have).

Tip: auto ETTR does it for you.

a1ex

Another test with a fake dual ISO from two ISO-bracketed shots from Audionut: 100.CR2 and 1600.CR2.


fake_dual_iso 100.CR2 1600.CR2
cr2hdr out.dng --debug-blend
mv out.DNG final-output.dng


Highlights:


ufraw-batch --temperature=3500 --green=0.8 --exposure=0.5 100.CR2          --out-type=ppm --output=- | convert - -crop 1200x800+425+2500 hi-100.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=-3.5 1600.CR2        --out-type=ppm --output=- | convert - -crop 1200x800+425+2500 hi-1600.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=1.5 fullres.dng      --out-type=ppm --output=- | convert - -crop 1200x800+425+2500 hi-fullres.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=1.5 halfres.dng      --out-type=ppm --output=- | convert - -crop 1200x800+425+2500 hi-halfres.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=1.5 final-output.dng --out-type=ppm --output=- | convert - -crop 1200x800+425+2500 hi-final-output.jpg


100 and 1600 (left is ground truth for highlights):


full-res and half-res (reconstructed from the fake dual ISO shot)


final output (reconstructed from the fake dual ISO shot)


Midtones:

ufraw-batch --temperature=3500 --green=0.8 --exposure=2.5 100.CR2          --out-type=ppm --output=- | convert - -crop 1200x800+1750+2650 mid-100.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=-1.5 1600.CR2        --out-type=ppm --output=- | convert - -crop 1200x800+1750+2650 mid-1600.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=3.5 fullres.dng      --out-type=ppm --output=- | convert - -crop 1200x800+1750+2650 mid-fullres.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=3.5 halfres.dng      --out-type=ppm --output=- | convert - -crop 1200x800+1750+2650 mid-halfres.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=3.5 final-output.dng --out-type=ppm --output=- | convert - -crop 1200x800+1750+2650 mid-final-output.jpg


100 and 1600 (ground truths):


full-res and half-res (reconstructed from the fake dual ISO shot)


final output (reconstructed from the fake dual ISO shot)



Shadows:

ufraw-batch --temperature=3500 --green=0.8 --exposure=6.5 100.CR2          --out-type=ppm --output=- | convert - -crop 1200x800+3650+2600 shad-100.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=2.5 1600.CR2         --out-type=ppm --output=- | convert - -crop 1200x800+3650+2600 shad-1600.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=7.5 fullres.dng      --out-type=ppm --output=- | convert - -crop 1200x800+3650+2600 shad-fullres.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=7.5 halfres.dng      --out-type=ppm --output=- | convert - -crop 1200x800+3650+2600 shad-halfres.jpg
ufraw-batch --temperature=3500 --green=0.8 --exposure=7.5 final-output.dng --out-type=ppm --output=- | convert - -crop 1200x800+3650+2600 shad-final-output.jpg


100 and 1600 (right is ground truth for shadows):


full-res and half-res (reconstructed from the fake dual ISO shot)


final output (reconstructed from the fake dual ISO shot)


Feel free to repeat this test on your own bracketed images (you don't need any source code modifications; simply change your crop windows, exposures, white balance, and then paste the commands in the terminal).

Tools you need: fake_dual_iso.exe, cr2hdr, ufraw (I used ufraw-mod), ImageMagick and a Unix-like shell.

Happy pixel peeping!

P.S. try getting a better blending between fullres and halfres (compared to my final output). You may try getting as close to the ground truths as you can.

Audionut

Can you update fake_dual_iso to accept tiff?

I'd like to test my theory of applying noise reduction on the dark ISO.

a1ex

It's not quite straightforward. I think the easiest way is to split the tif into RGB, save each one as pgm, load them in fake_dual_iso.c with the existing routine, and redo the bayering.

Here's the source if you want to try: http://a1ex.magiclantern.fm/bleeding-edge/fake_dual_iso.c

To build it, copy the Makefile rules from cr2hdr, but use this source file instead.

Even if you denoise from dxo, you will get a linear (RGB) DNG, so you need to write the code to load it.

Therefore, I believe the really easy way is to implement the denoise filter in cr2hdr (in the "dark" image, probably before interpolation). Try a bilateral filter, it's fairly easy to write and shouldn't blur edges too much.

joebone

when reviewing these pictures in the camera they will look all banded and stuff right, it wont look right till post processing? 

sqd

Quote from: joebone on February 06, 2014, 04:58:57 PM
when reviewing these pictures in the camera they will look all banded and stuff right, it wont look right till post processing?

Yep.

Marsu42

Quote from: joebone on February 06, 2014, 04:58:57 PM
when reviewing these pictures in the camera they will look all banded and stuff right, it wont look right till post processing?

There is/was an experimental patch to display part of the picture merged in camera - it's still available in the famed Tragic Lantern :-p though at least I never got it working on the 6d, but in ML it's not in the current dual_iso module... probably for good reason.

Personally, I've gotten some training in evaluating dual_iso shots in camera (sharpness & exposure) so I'm not so desperate for an immediate preview anymore ... I'd rather have the wb in acr correct, but I hope we acr users will figure something out sooner or later.

kyrobb

How do I get Dual ISO to work with video on the 50D. When I turn video on, it won't let me use dual iso. It says [MOVIE] This feature requires you shooting RAW.  I'm using the latest nightly and have Raw enabled... What am I doing wrong? I can only seem to shoot dual iso stills.

ayshih

Unless I'm mistaken, the 50D (along with other cameras of the same generation) cannot make use of Dual ISO in movie mode because it does not use ISO registers in the same way as in photo mode.  The error message is misleading because Dual ISO can be disabled because the ISO register is not defined, not just because RAW recording is not enabled.
Canon EOS 50D | 17–40mm f/4L & 70–300mm f/4.5–5.6 DO IS | Lexar 1066x

Audionut

I would have been using mini_iso on these.  BL 64, WL 16380.
https://dl.dropboxusercontent.com/u/34113196/ML/_46A3766.CR2



The same thing happens with different recovery ISOs.
Here is a preview of 100/6400 for instance.


a1ex

It converts fine with the upcoming 20-bit engine (I should clean it up and post an update).

Output black level is 240 with both engines.

Marsu42

Quote from: a1ex on February 11, 2014, 07:49:31 AM
It converts fine with the upcoming 20-bit engine (I should clean it up and post an update).

That's of course interesting and I'm looking forward to it, just one note: If the fp files are significantly larger than 16bit I wouldn't mind if you keep maintaining the smaller version, I'm saying this because I know some people don't care about disk space, but some do.

Maybe you'll add some branching to cr2hdr to automatically decide if 16bit is enough for this specific shot or a higher bit depth is required?

a1ex

Nope, the output is still 16-bit, only the internal processing will be 20-bit.

If I'll add an option for output, that would be floating point DNG (and the default will be still 16-bit).

Audionut


SpcCb

Quote from: a1ex on February 11, 2014, 08:35:01 AM
Nope, the output is still 16-bit, only the internal processing will be 20-bit.

If I'll add an option for output, that would be floating point DNG (and the default will be still 16-bit).

Is 20-bit is a limitation?
(I'm thinking about 32-bit internal -> 32-bit integer FITS file output for linear work purposes)

BTW 16-bit floating point DNG output should be nice, indeed.

a1ex

I use some lookup tables (from linear to log and back), and for this, 20-bit is already on the large side.

Floating point makes sense on CeroNoice - http://www.magiclantern.fm/forum/index.php?topic=9581

SpcCb

Indeed, 2*12-bit - overlap should fit in 20-bit.
Mathematically it makes sense for 3 images or more, so not the case with dual_iso.

Marsu42

Quote from: a1ex on February 11, 2014, 04:19:09 PMI use some lookup tables (from linear to log and back), and for this, 20-bit is already on the large side.

Does this 20bit processing obsolete the --soft-film option you recently introduced to cr2hdr, or is it still worth experimenting with that?

It looks like it might fix one problem of acr: even with highlight recovery @max some dual_iso files still have to much contrast in the highlights so I need to use tone curves in LR - which might lower iq, or is this about the same like your cr2hdr curve?

Audionut

20bit is just the internal processing.  The output could still contain information pushing the limits of 16bit.  Here, --soft-film will help.

mrd777

When I put my canon iso to 100 and dual_iso's iso to 1600, then take a photo, it comes out with horizontal lines in my LCD - as expected. However, when I go to my comp and put the CR2 into cr2HDR.exe, it processes and outputs a DNG with only iso 100 (very dark)... I try to use Camera Raw to pull it back up in brightness, but it doesn't go enough, and it is super noisy.

any ideas?

Audionut

Do you have your highlights exposed close to saturation (clipping)?

mrd777

No. I'm in my room with a computer monitor which is super blown out, unless I go to iso100 with the Canon ISO, which is what I did, and then ML with 1600 on the dual_iso

Audionut

You should ensure that you have your base ISO (ISO 100 in this case) exposure at close to saturation.  That is, the really bright bits in the scene should be at the right hand side of the histogram.

Why? 

Shot noise is not affected by ISO.  The recovery ISO (ISO 1600 in this case) doesn't fix the shot noise, it only cleans up the noise inherent in the camera electronics.  Higher ISOs are cleaner then lower ISOs:  http://www.clarkvision.com/articles/evaluation-canon-5diii/

In post processing, dual_iso files have an extended dynamic range that is pushing the limits of the 16bit output.  So here, if you have your highlights exposed at say -1.5 EV below saturation, you lose out on 3 fronts. 

First:  Your captured scene contains an increased amount of shot noise (then it would if the scene was exposed correctly for the highlights).
Second:  Your shadows are digitally stored with to few bits.  <-- research bit depth/tonal range
Third:  Your post processing software may struggle to correctly render the brightness.


A computer monitor in a dark room will result in a dynamic range well in excess of 11 EV.  Here, the dark areas of the scene will suffer from shot noise even with the highlight exposure set correctly.  Here, dual_iso will clean the electronic noise added by the camera, but cannot clean the shot noise.