Author Topic: Dual ISO - massive dynamic range improvement (dual_iso.mo)  (Read 1638428 times)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12390
  • Quarantined
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1375 on: October 15, 2013, 06:36:36 PM »
Would be nice if you can find a before/after example where the difference is clearly visible.

RenatoPhoto

  • Moderators
  • Hero Member
  • *****
  • Posts: 1509
  • 5DM3 / 7D
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1376 on: October 15, 2013, 07:44:47 PM »
I have improvements in shadows but not in highlights.  No banding examples.
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

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6441
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1377 on: October 15, 2013, 10:00:15 PM »
I'm re-processing all my dual_iso cr2 now, these updates really keep my computer busy :-p ... fortunately with Lightroom you just need to replace the old dng & update the preview, all the metadata is in the LR database.

Smart workflow. I noticed that LR kept the metadatas when switching cr2 to dngs after applying xmp sidecar files. Didn,t try a fully new conversion yet though of my older cr2:s

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1378 on: October 16, 2013, 09:13:39 AM »
Would be nice if you can find a before/after example where the difference is clearly visible.

The only problem shot I delivered is unchanged, it's still colorful confetti time :-\ ... https://bitbucket.org/Marsu42/ml-mod6d/downloads/131003151753_D2X005512-CR2HDR131015.jpg

Could you provide a way to produce *two* dng from cr2hdr, one bright and one dark (with duplicated scanlines)? That would make it easier to see where a problem was, i.e. how the composite shots were exposed, and if a problem was there even before cr2hdr assembly.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12390
  • Quarantined
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1379 on: October 16, 2013, 09:16:04 AM »
Lookup "fullres.dng" in cr2hdr.c and mark that block with #if 1. You'll get a bunch of intermediate files.

You can do that everywhere you see calls to save_dng.

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1380 on: October 16, 2013, 10:18:14 AM »
Lookup "fullres.dng" in cr2hdr.c and mark that block with #if 1. You'll get a bunch of intermediate files.

Thanks, I'll do that - and I know you're not very keen to add any switches to cr2hdr, but imho this option would be useful to all people and not only to the few who compile ml themselves or read this thread. Also the intermediate files could be a last resort if cr2hdr fails on some shots, you can then blend the intermediate file with the good parts from cr2hdr.

Yesyesyes, I could do a pull request, but I feel sufficiently busy with the auto_iso module, I've got a couple of (imho :-)) very nice ideas for that.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12390
  • Quarantined
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1381 on: October 16, 2013, 11:25:02 AM »
From your shot, I've cleaned up some of the dots with this trick:
Code: [Select]
                    int is_hot_small = (d > b && b < white_darkened);

but finding a general solution that doesn't break resolution charts is a bit harder. Also, locating hot pixels where the high ISO is overexposed is hard and I didn't try to solve it yet (a median filter with thresholding should help a bit).

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1382 on: October 16, 2013, 12:12:13 PM »
but finding a general solution that doesn't break resolution charts is a bit harder. Also, locating hot pixels where the high ISO is overexposed is hard and I didn't try to solve it yet (a median filter with thresholding should help a bit).

Thanks, I'll make my own cr2hdr with your patch for the time being (these were just test shots anyway) - but imho having a public fix for this is important, dual_iso is just made for high-dr longtime exposures since you really wouldn't want to bracket in these situations.

Question is if you can find auto-detection algorithms for all possible contingencies without years of coding and wading through thousands of samples, if not you might have no other option than to fall back for command line parameters for local tuning like this hot pixel removal.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12390
  • Quarantined
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1383 on: October 16, 2013, 12:32:37 PM »
I'll try a thresholded median filter; if I get good results, I'll post it.

Meanwhile, here's an interesting read: http://nikonhacker.com/viewtopic.php?t=85

Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3588
  • Blunt and to the point
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1384 on: October 17, 2013, 05:42:37 AM »
Doesn't Canon apply some form of noise reduction even when it's turned off, even for raw?

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12390
  • Quarantined
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1385 on: October 17, 2013, 10:17:38 AM »
The noise seems pretty much white to me, so I don't think there is any noise reduction applied.

ISO 100 crop from a dark frame:


Octave code for plotting the autocorrelation:
Code: [Select]
system("dcraw -v -d -r 1 1 1 1 -g 1 1 -k 2000 -S 2096 100.CR2")
im = double(imread('100.pgm'));
im = im(501:600, 501:600);

imshow(im, []);
set(gca,'position',[0,0,1,1])
print -dpng "-S100,100" crop.png

x = xcorr2(im - mean(im(:)));

imshow(x, []);
set(gca,'position',[0,0,1,1])
print -dpng "-S199,199" corr.png

sletts02

  • Freshman
  • **
  • Posts: 62
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1386 on: October 18, 2013, 12:25:58 AM »
I've been out of the Dual ISO game for a while now and was hoping somebody could enlighten me on some topics.

Video Processing - is this the process?
1) RAW file on to PC
2) RAW2DNG
3) DNG's on to CR2HDR?

Does "RAWanizer" automatically do this process? It produced some non-banded DNGs that have less aliasing and comparable range so I am unsure. When the files were put straight in to RAW2DNG they came out alternated banding.

Are these the expected results?
Before cr2hdr: https://www.dropbox.com/s/mhgqe2eqkva67kq/beforecr2hdr.dng
After cr2hdr: https://www.dropbox.com/s/j22onsqq70yoq1e/aftercr2hdr.DNG

Should there be more shadow recovery in the processed version? Or am I doing something wrong?

Here is the resulting processed JPG, am I meant to raise the shadows and blacks 100%?


Redefine

  • Just arrived
  • *
  • Posts: 1
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1387 on: October 18, 2013, 01:48:39 PM »
Hi,

Long time ML follower first time poster here.. First of all, AWESOME job on this dual ISO, can't wait for it to be fully operational and integrated! This method is the realization of a thought I had some time ago. But with me being completely useles with programming that was just a wish or a dream. So I would like to thank you for making this reality!

I do know that I shouldnt ask this question.. But after reading the update in the first post about this function being available for most models I am wondering if this function is available for the 1100D/T3? I downloaded the most recent nightly build but I cant find it anywhere in the menu system. Where should it be located exactly?

THANK YOU once again a1ex!

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12390
  • Quarantined
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1388 on: October 18, 2013, 02:27:23 PM »
According to http://nanomad.magiclantern.fm/jenkins/features.html it doesn't work yet, but I'm pretty sure it's possible.

Here are the findings from Panzani, so you can start researching from here (I guess you just have to find the repeated pattern, i.e. which bits are for ISO):

Code: [Select]
         /*
         100 - 0     0x407444B2
         200 - 0x120 0x407444C6
         400 - 0x240 0x407444DA
         800 - 0x360 0x407444EE
         1600 -0x480 0x40744502
         3200 -0x5A0 0x40744516
         */
         is_1100d = 1;
 
         FRAME_CMOS_ISO_START = 0x40745446; // CMOS register 00    00 - for LiveView, ISO 100 (check in movie mode, not photo!)
         FRAME_CMOS_ISO_COUNT =          6; // from ISO 100 to     3200
         FRAME_CMOS_ISO_SIZE  =         28; // distance between     ISO 100 and ISO 200 addresses, in bytes
 
         PHOTO_CMOS_ISO_START = 0x407444B2; // CMOS register 00    00 - for photo mode, ISO
         PHOTO_CMOS_ISO_COUNT =          6; // from ISO 100 to     3200
         PHOTO_CMOS_ISO_SIZE  =         20; // distance between     ISO 100 and ISO 200 addresses, in bytes

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12390
  • Quarantined
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1389 on: October 18, 2013, 04:47:50 PM »
Pixel peepers: which one looks best?





This is the reconstruction of only one exposure (the dark one), without any prior info from the bright one (so I'm just evaluating the interpolation methods). The interpolation is done before debayering. You may choose any of them, or any linear combination of them.

For reference: here's an interpolation done after debayering, with GIMP, Lanczos sinc filter. Don't choose this one, because it's too hard to implement :P


Debayering was done in all cases with ufraw, AHD, chroma smoothing, no denoise.

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6441
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1390 on: October 18, 2013, 05:45:29 PM »
 :) Nice test!
I think I decide for the last one. First I liked the 2nd exemple but now I,m leaning more towards the last two. Looking at the hair I think the last one, looking att the green tree background I really like the smooth clean in number one, looking at the shirt, either green or magenta, hmm ,Probably the last.

Marsu42

  • Contributor
  • Hero Member
  • *****
  • Posts: 1557
  • 66d + flashes
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1391 on: October 18, 2013, 09:21:33 PM »
Pixel peepers: which one looks best?

For me: The second from the right, is looks more natural, closer to your "ideal" GIMP version and less over-sharpened than the very right one. It's an interpolation after all, and it shouldn't try too hard to reconstruct data that isn't there, I can do sharpening myself in postprocessing and double sharpening (in dual_iso and post) might even result in artifacts.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12390
  • Quarantined
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1392 on: October 18, 2013, 09:29:35 PM »
It's not about sharpening (I didn't apply any), but about minimizing the aliasing artifacts.

The texture looks like this:



(not sure if the purple thing is lens fringing, because this crop is from an edge; maybe Danne can tell us)

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12390
  • Quarantined
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1393 on: October 18, 2013, 09:52:40 PM »
Some more crops, this time from the final output:





Top: mean23
Bottom: AMaZE interpolation
Left: no chroma smoothing
Right: 5x5 chroma smoothing

(so, top right is pretty much what you get now with the current version)

engardeknave

  • Senior
  • ****
  • Posts: 339
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1394 on: October 18, 2013, 10:28:37 PM »
I think it's a contest between the top right and bottom left. I'd lean toward the chroma smoothing because it seems like there's a lot of color bleeding with the AMaZE interpolation.

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6441
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1395 on: October 18, 2013, 11:02:19 PM »
It's not about sharpening (I didn't apply any), but about minimizing the aliasing artifacts.

The texture looks like this:



(not sure if the purple thing is lens fringing, because this crop is from an edge; maybe Danne can tell us)

It,s my good old canon 20-35mm f2.8 if I remember correct, and there,s surely some purple fringing going on from the lens :)

Danne

  • Contributor
  • Hero Member
  • *****
  • Posts: 6441
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1396 on: October 18, 2013, 11:10:46 PM »
Some more crops, this time from the final output:





Top: mean23
Bottom: AMaZE interpolation
Left: no chroma smoothing
Right: 5x5 chroma smoothing

(so, top right is pretty much what you get now with the current version)


Top right looks really good. Hard to beat.


Audionut

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3588
  • Blunt and to the point
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1397 on: October 19, 2013, 05:04:37 AM »
Nocs has color artifacts in the shirt, amaze version is better but the artifacts are still there.  Also in the highlights in the hair above, and above left of the hair clip.  However they don't suffer the aliasing in the hair on the left side of the head near the eye socket.  Nocs also has sharper fine detail very noticeable in fine strands of hair on the back of the head.

My pick would be amaze-mean2w-nocs.  Sharper finer detail without the aliasing and less color artifacts then mean23-nocs.

A lot of the color artifacts seem to be on specular highlights.  Can you desaturate these areas?

f3000

  • New to the forum
  • *
  • Posts: 2
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1398 on: October 19, 2013, 05:11:43 AM »
I prefer the one produced by AMaZE interpolation for it has more fine detail and less color artifacts.

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12390
  • Quarantined
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #1399 on: October 19, 2013, 08:13:43 AM »
A lot of the color artifacts seem to be on specular highlights.  Can you desaturate these areas?

That's where I'm applying chroma smoothing. To desaturate, I think I need to know the white balance first.

It's an interpolation after all, and it shouldn't try too hard to reconstruct data that isn't there

I'm only trying to reconstruct data that is there. Current method does not fully exploit the inter-channel correlation, because I'm interpolating from the nearest Bayer pixels of the same color. With a temporary demosaic I have color info at every pixel, so I can find neighbouring pixels at a smaller distance => the Nyquist frequency should increase a little. Sure, the demosaiced pixels are guessed, not sampled, so I need a really good guess (for sure, one that considers the influence of say a red pixel to guess a green pixel, otherwise there will be no effect on Nyquist frequency. I'm pretty sure all modern demosaic algorithms do that  - you have the proof in the pink dot remover thread).