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 2 Guests are viewing this topic.

Lupo_wolfi

Quote from: a1ex on July 16, 2013, 06:33:50 PM
Time for the first real image quality improvement in ML history :)

Postprocessing

- For CR2 files: cr2hdr.c (Windows:cr2hdr.exe). It requires dcraw and (optional) exiftool in your executable path (they are in the zip). Drag and drop the CR2 files over cr2hdr.exe.

- For RAW video files: latest raw2dng.exe. extract the DNGs with any method you like (e.g. raw2dng), then drag the DNG files over cr2hdr.exe

- To get a natural HDR look: try my automatic color grading script.


It works as long the group of DNG files to drag on cr2hdr.exe, is less than 2300.
In small groups of DNG it works. But if I drag the whole 2300 DNGs files, it tells me that "File name or extention is too long"

djronbxs

why when i process the photos with cr2hdr im loosing the icc profile information ?

thanks
ron

Erik

Problem and Possible Solution with Pink highlights in Video

I'm using dualiso a lot in video, and want to share some fails/successes with pink highlights. Maybe we can tweak some settings to get the best results:


Workflow
I'm running all .RAW files against raw2dng, then running the DNGs against cr2hdr, then finally a converter to ProRes or another proxy.

Problem
When I use the latest cr2hdr.exe, if the shot has really tough lighting I get nasty pink lines in my highlights that are not present in the interlaced DNG I get from raw2dng. So the culprit is likely to be cr2hdr, right?

Possible Solutions
I've tried 5 different versions of cr2hdr (thanks A1ex for all the hard work), and have found varying degrees of success:

You can view DNGs, exes, logs, etc:
https://www.dropbox.com/sh/78nozdsmyu4waei/-Xu6-IjAOs

I'll keep posting results

cr2hdr_histmatch -- overall best; eliminated most pink interpolation highlights and green pixelation; does produce some flickering in highlights an a few pink highlights


cr2hdr_hot -- eliminated interpolation, eliminated most pinks, eliminates some small green pixelation, but still has some pink highlight in a few frames


cr2hdr_histmatch2 -- eliminated interpolation, eliminated most pinks, but still has some pink highlight and green pixelation in a few frames


cr2hdr_histmatch3 -- eliminated interpolation, eliminated most pinks, but still has some pink highlight and green pixelation in a few frames

5d mkiii - RAW Hack Firmware Dated-2013.Aug.6.

Erik

Video produced using cr2hdr-histmatch. Note the highlight flashing and pink highlights near the end of the video.


Still has some highlight issues:
5d mkiii - RAW Hack Firmware Dated-2013.Aug.6.

Audionut

Have you tried the cr2hdr from the first post of this thread?  It was updated about a month ago iirc.

TheFilmGuy

Thank you! This feature works flawlessly minus the resolution loss.









Erik

Thanks Audionut.

Quote from: Audionut on January 01, 2014, 11:20:47 PM
Have you tried the cr2hdr from the first post of this thread?  It was updated about a month ago iirc.

Yes. It yields the worst results - pink interpolation and green pixelation in highlights.
Currently histmatch rev1 produces the best images, though it still has issues - flickering highlights, some pink highlights.
I'm assuming I need to adjust the highlight parameter to something lower than 15000.

Any suggestions?
5d mkiii - RAW Hack Firmware Dated-2013.Aug.6.

Erik

Checking the white level, it shifts from 12500 to 15886 - big shift that causes my highlights (sky in this case) to render as either blue with clouds or blown-out white.
Given that these changes might happen from frame to frame, that would explain the flickering highlights and pinks.


I tried tweaking the saturation in level in dcraw and got the following:

at 12500


at 15886


Any thoughts on how best to implement a solution?
5d mkiii - RAW Hack Firmware Dated-2013.Aug.6.

MarS

Hi all!  :)

Can I have access to some raw images (Dropbox or anything else)? I would like to do some tests with a HDR software that I designed.

If I can provide Dual Iso support, that would be great!  :D

a1ex

MarS: there are many links to raw files in this thread (one is in the first post), and I believe most of them are still online. Look for posts showing problems with some particular raw file. Can you share some details about your software?

@erik: it's indeed a white level problem. I should provide a way to override it in the command line, because right now it's autodetected. It's important to have it correct - or a little underestimated - during the conversion; I've changed it in white_detect_brute_force to 10000 and the output seems fine.

For flicker-free video, you have to equalize the exposure somehow. Either by playing with the white point, or maybe also with this deflickering script: http://www.magiclantern.fm/forum/index.php?topic=8850.0

MarS

Thank you a1ex and congratulations for your brilliant idea!!! :)
I've already downloaded the first link (Orange Juice Bottle). Unfortunately many links are dead. I'll still take the time to check all the pages for cr2 files.

I'm working on a software called MarScaper HDR for Mac. For more details, you can have a look at here: MarScaper HDR web site.

I hope I'll be able to add Dual Iso support to my roadmap. I have already started studying your PDF to understand all the machinery. Very smart approach. If I find an idea to fight against artifacts, I'll share it with pleasure.

a1ex

The current algorithms are far more advanced than what's in the paper, but the background info still applies; these days, even in highlights where you only have half-res data, the interpolation is clean in many practical cases (except for resolution charts and power lines). But of course, any improvement is welcome.

100 bracketed pictures? Come on... take a look at my experiments with CeroNoice ;)

MarS

Quote from: a1ex on January 13, 2014, 04:00:05 PM
100 bracketed pictures? Come on... take a look at my experiments with CeroNoice ;)
In normal "human" conditions it has no interest of course. It's more a marketing tool.  ;D

But for more specifics conditions (High Iso, very low signal)...

EOS 20D - 160x30s - 1600 Iso

And of course, some astronomical subjects have also a very high dynamic range: Andromeda Galaxy, Orion nebula, etc.

SpcCb

Quote from: MarS on January 13, 2014, 06:35:20 PM
In normal "human" conditions it has no interest of course. It's more a marketing tool.  ;D

But for more specifics conditions (High Iso, very low signal)...
(...)

And of course, some astronomical subjects have also a very high dynamic range: Andromeda Galaxy, Orion nebula, etc.
Maybe it could help:

According to Barton, H. and Byrne, K. Introduction to Human Vision, Visual Defects & Eye Tests (March 2007), a exercised human vision is capable of a DR about ~60db (~20 stops) in an instant field of view.
So, on a base of ~10 stops per frame (basic DSLR capability) and with a overlap range, no needs to take 100 frames to get a HDR image closed to the human vision.

About astronomical imaging, the number of frames is mainly to increase the SNR, not the DR.
For most objects _even those mentioned here_ a dozen of frames is good enough to render the full dynamic, especially with modern multiscale HDR processings.

stevefal

Steve Falcon

Audionut

http://en.wikipedia.org/wiki/Human_eye

QuoteDynamic range

The retina has a static contrast ratio of around 100:1 (about 6.5 f-stops). As soon as the eye moves (saccades) it re-adjusts its exposure both chemically and geometrically by adjusting the iris which regulates the size of the pupil. Initial dark adaptation takes place in approximately four seconds of profound, uninterrupted darkness; full adaptation through adjustments in retinal chemistry (the Purkinje effect) is mostly complete in thirty minutes. Hence, a dynamic contrast ratio of about 1,000,000:1 (about 20 f-stops) is possible.

http://en.wikipedia.org/wiki/Dynamic_range

Factor (power) 1,000,000 = Decibels 60 = Stops 19.9

a1ex

Quote from: SpcCb on January 15, 2014, 02:57:23 AM
About astronomical imaging, the number of frames is mainly to increase the SNR, not the DR.

DR is computed as log2(full well) - log2(noise in complete darkness). So, if you increase SNR by stacking identical exposures, you will also increase DR.

For example, if you stack 64 identical exposures, you get 8x less noise (stdev), so your DR increases with 3 stops.

dmilligan

Quote from: stevefal on January 15, 2014, 06:52:03 AM
I think 60dB is about 10 stops.
You're using the amplitude definition of decibels, not the power or intensity definition which is 10 * log10(ratio). If you have field amplitudes then the equation becomes 10 * log10 ( ratio^2 ) = 20 * log10(ratio), but that is incorrect to use here, we're measuring the intensity of the light, not the amplitude of the field.

20ev = 2 ^ 20 = 1048576
10 * log10(1048576) = 60.2059991328 dB

l_d_allan

Quote from: a1ex on January 15, 2014, 08:27:31 AM
For example, if you stack 64 identical exposures

But ... with astrophotography, would those really be identical exposures, as everything is moving.  Or would you need to be on a rotating, motor-driven tripod like telescopes use? (or is that assumed for this discussion?)

BTW ... impressive/intimidating math ...


SpcCb

Quote from: a1ex on January 15, 2014, 08:27:31 AM
DR is computed as log2(full well) - log2(noise in complete darkness). So, if you increase SNR by stacking identical exposures, you will also increase DR.

For example, if you stack 64 identical exposures, you get 8x less noise (stdev), so your DR increases with 3 stops.
Of course you can increase DR by increasing SNR.
But the main goal of stacking is about SNR gain, not DR.

I can't confirm your reasoning about the link SNR/DR (huge offtopic in perspective :D), but in most of cases it's not relevant to run 64 frames acquisition just to gain 3 DR stops in astrophotography.

Quote from: l_d_allan on January 15, 2014, 02:29:25 PM
But ... with astrophotography, would those really be identical exposures, as everything is moving.  Or would you need to be on a rotating, motor-driven tripod like telescopes use? (or is that assumed for this discussion?)
(...)
Your question is very interesting: I did not see anybody ask 'and what about dithering frames?' or other calculated miss-alignment pre-processing to drastically reduce noises (please not the 's' ending noise).
However, it's a bit offtopic...

feureau

Not sure if I should put this on the EOS-M thread or here, but here goes: Has anyone been getting these dots? http://i.imgur.com/g2wRO2H.png

It appears to be the EOS-M phase detection pixels. And it only appears on some photos. Any ideas what's going on/how to fix it?

CR2 and converted DNG:
https://www.dropbox.com/s/joajfhtsrtpbxad/DualISOPinkDot.zip

Running latest TL and CR2HDR

1%

Old issue, look for pink dot remover. Also this is apparently a problem on 650D/700D too.

a1ex

A chroma blur (median filter on R-G and B-G) on the input image should fix it. Of course, the code must be modified to only average pixels from the same channel *and* ISO.

MarS

So much to say about astronomy! Enough to spend many nights but my english is not good enough I think! :)

To stay on topic, my first test is pretty conclusive even if I have to improve many things...
http://www.youtube.com/watch?v=I8oiPVUCkss

My approach is may be a little bit different: I extract the two frames and inject them in my HDR fusion.