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.

a1ex

Would be nice if you can find a before/after example where the difference is clearly visible.

RenatoPhoto

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

Quote from: Marsu42 on October 15, 2013, 06:30:08 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

Quote from: a1ex 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.

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

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

Quote from: a1ex 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.

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

From your shot, I've cleaned up some of the dots with this trick:

                    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

Quote from: a1ex on October 16, 2013, 11:25:02 AM
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

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

Doesn't Canon apply some form of noise reduction even when it's turned off, even for raw?

a1ex

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:

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

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

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

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):


         /*
         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

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

 :) 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

Quote from: a1ex on October 18, 2013, 04:47:50 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

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

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

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

Quote from: a1ex 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)

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

Quote from: a1ex 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)


Top right looks really good. Hard to beat.


Audionut

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

I prefer the one produced by AMaZE interpolation for it has more fine detail and less color artifacts.

a1ex

Quote from: Audionut on October 19, 2013, 05:04:37 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.

Quote from: Marsu42 on October 18, 2013, 09:21:33 PM
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).