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

a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2725 on: March 17, 2016, 12:46:27 PM »
Dual-ISO


Updated cr2hdr source code to address this issue. Tested on the above example DNG, and on a 600D video DNG with similar black level issues.

The fix has two parts:
- use black level from EXIF if optical black data is not available (this should give results identical to MLVFS - not tested)
- analyze the shadows areas of the image; if it finds crushed blacks, the black level is lowered.

The first part was not needed so far because all the ML cameras that could record dual iso in video mode had the black level 2048. 5D2 is different.

The second part is actually a heuristic, and may help if EXIF data is incorrect. It worked on my test samples, but I'm not sure how well it will perform on other images. I'm also not sure how well it works with --same-levels (in theory, if crushed blacks are found, the best guess for black level should be the lowest value from all images).

The algorithm can be used in regular raw files as well (to check for incorrect black level).

On this test image, I've got:
Code: [Select]
Black level     : 1795 is too high, using 1792

and the change actually reveals some extra shadow details (1795 vs 1792):


If it will pass my test suite, I'll upload a binary version as well; until then, you need to compile it.

Danson Delta-40

  • New to the forum
  • *
  • Posts: 46
  • GOING POSTAL SINCE 1995 - 7D FTW
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2726 on: March 17, 2016, 08:10:39 PM »
I'm going to ask what I know everyone wants to ask but is too afraid to do so.

Does this increase the possibility that other cameras will also be able to shoot dual iso raw video? (7D??? :D)

Ignore this if u think this is a troll post :'<
GOING POSTAL SINCE 1995 BABY

Tai.Fighter

  • New to the forum
  • *
  • Posts: 31
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2727 on: March 18, 2016, 01:37:43 AM »
Thanks dfort. I got the binaries from the ML downloads page, which is about as official of a source I could find... I'll take a shot using your bitbucket download and report back before investigating those other options, thank you so much for helping!

UPDATE:

I took screenshots of the cr2hdr that I tried before, and your bitbucket download. The one from ML download page gave me this:



I tried your bitbucket, and got this instead:

Input file      : C:\Users\USER\Desktop\New CDRHR\M14-201600066.dng
Camera          : Canon EOS 5D Mark III
Full size       : 1920 x 1080
Active area     : 1920 x 1080
Black borders   : N/A
ISO pattern     : BBdd RGGB
White levels    : 10000 5000
Noise levels    : 8.00 8.00 8.00 8.00 (14-bit)
Doesn't look like interlaced ISO
ISO blending didn't work

screenshot:




dfort

  • Guest
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2728 on: March 18, 2016, 02:29:26 AM »
@Tai.Fighter

It looks like the first cr2hdr build you tried says, "Doesn't look like interlaced ISO" the kept on processing and the second build stops after the "Doesn't look like interlaced ISO" message. In both cases cr2hdr is telling you that these aren't Dual ISO DNG files. If processing continues and treats them as Dual ISO the results will appear incorrect.

I did a search for "raw2cdng dual iso" and it looks like that's probably the problem. Try another conversion program like mlv_dump. This was updated recently--could someone supply a link to the latest Windows build? I'm only finding old "official" builds.

I'm going to ask what I know everyone wants to ask but is too afraid to do so.
Does this increase the possibility that other cameras will also be able to shoot dual iso raw video? (7D??? :D)
Ignore this if u think this is a troll post :'<

I don't think that's a troll post--the 7D is about the same vintage as the 5D2 so maybe it will work. Of course someone has to be the guinea pig.

Tai.Fighter

  • New to the forum
  • *
  • Posts: 31
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2729 on: March 18, 2016, 03:41:39 AM »
My google-fu sucks, but I can't find MLV_dump for windows anywhere...  I'd be willing to take an old official one if you have it!

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2303
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2730 on: March 18, 2016, 05:29:18 AM »
Try  MLVFS for Windows it dose dual iso
or  MLVProducer it has some dual iso support.

My google-fu sucks, but I can't find MLV_dump for windows anywhere...  I'd be willing to take an old official one if you have it!
10 seconds to find
search box upper left hand corner of the web page , type mlv_dump
It was Number 8 in the result window
http://www.magiclantern.fm/modules/modules/mlv_dump.zip/mlv_dump.zip


dfort

  • Guest
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2731 on: March 18, 2016, 06:42:30 AM »
I posted the latest cr2hdr:experiment for Mac and Windows in my bitbucket download area. This is mainly for testing the Video - dual iso for 5D2 but it is of course open for anyone willing to live on the bleeding edge.

I also posted the latest version of mlv_dump for Windows. Seems like I'm having troubles compiling a Mac version after rebuilding my development environment. Anyway--getting off topic.

@Tai.Fighter please don't double post: http://magiclantern.fm/forum/index.php?topic=16890.msg164418;topicseen#msg164418

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3411
  • 5D3 | M1 | 7D | 70D | SL1 | M2 | 50D
Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2732 on: March 18, 2016, 07:04:23 AM »
Excellent timing @a1ex (as usual) and Thanks @dfort for sharing the latest cr2hdr binary.
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2303
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2733 on: March 18, 2016, 08:27:58 AM »
Thanks @a1ex for the fix  and thanks @dfort for the new complied cr2hdr.
Just tested with BarracudaGUI for dual iso on PC workstation ,
process the dual iso without any problem , there is a little difference in the mid tone area
there seems to more mid detail with MLVFS  but more shadow detail with the update CR2HDR.

One think I notice is with cr2hdr process file in resolve I had to use less exposure then mlvfs process file
by about half , e.g. cr2hdr was about 2.5 where mlvfs was 4.6 , interesting .

plus I also notice the black level are the same but white is lower cr2hdr is 40000 , mlvfs is 60000
I guess that why the mid are brighter .


Non process Dual ISO 100/800 1856x928  from 5D2

Non_process_M13-2146.MLV.frame_000000
by RedDeerCityTV, on Flickr

New CR2HDR process though BarracudaGUI


New_CR2HDR_M13-2146.MLV.frame_000000
by RedDeerCityTV, on Flickr

MLVFS process dual iso on windows7

M13-2146_000000
by RedDeerCityTV, on Flickr

Old CR2HDR , wrong white & black levels


Old_CR2HDR_M13-2146_000000
by RedDeerCityTV, on Flickr


Link to my dropbox with Dual ISO Cdng if any one would like check them out

 Non process dual ISO --> https://www.dropbox.com/s/qnzst1571q766pu/Non_process_M13-2146.MLV.frame_000000.dng?dl=0
New CR2HDR dual ISO       https://www.dropbox.com/s/3w24ifc4opurmgi/New_CR2HDR_M13-2146.MLV.frame_000000.DNG?dl=0
Old CR2HDR dual ISO        https://www.dropbox.com/s/3al9oe8oerahtzv/Old_CR2HDR_M13-2146_000000.DNG?dl=0
MLVFS dual ISO (PC ver.)   https://www.dropbox.com/s/c7punwsgezdmopt/M13-2146_000000.dng?dl=0



Danne

  • Developer
  • Hero Member
  • *****
  • Posts: 7406
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2734 on: March 18, 2016, 08:28:55 AM »
Great progress.
Here is a version of MLP with the experiment cr2hdr build for 5D mark 2 (and other cams to it seems). It will work right out of the box for developing the dng files. Havn,t had time to test it out and don,t own a 5d mark 2. (thanks dfort for compiling)

MLP_5D2
https://www.dropbox.com/s/vawstdji3yif8sk/MLP_5D2.zip?dl=0

Works like this
1 - Download and then double click MLP(.workflow) to install
2 - Right click and select MLP from the contextual menu on a folder containing dual iso MLV or RAW or MLV-lite footage. Do this twice cause first time MLP creates a folder structure then quits. The second time will start processing. Same white level(avoid flicker) will be applied to all files and it works multithreaded.



a1ex

  • Administrator
  • Hero Member
  • *****
  • Posts: 12564
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2735 on: March 18, 2016, 10:00:04 AM »
For this example, the ideal black level appears to be 1794 (or 7176 on a 16-bit image), if we assume the shadowed area on the second black PC is pure black. To my eye, 1793 looks best.

So, this is a good example where my algorithm went too far.

The exposure difference is most likely from the different white levels. From the raw data, MLVFS is closer to the truth; the difference should be visible in specular highlights.

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 8497
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2736 on: March 18, 2016, 12:35:43 PM »
I posted the latest cr2hdr:experiment for Mac and Windows in my bitbucket download area.

Windows 8.1 will not allow me to run this exe for security reasons ...

Licaon_Kter

  • Hero Member
  • *****
  • Posts: 519
  • M

dfort

  • Guest
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2738 on: March 18, 2016, 07:30:03 PM »
What, you mean that your Windows doesn't trust my Macintosh?

(Oops--that remark is going to cost me another 900 seconds.)

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3411
  • 5D3 | M1 | 7D | 70D | SL1 | M2 | 50D
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2739 on: March 19, 2016, 12:04:03 AM »
@a1ex & crew -- instead of double posting but strongly felt this was worth mentioning for you guys to follow-up on what we have been digging through in regards to Dual-ISO videos for 5D2 here below...

http://www.magiclantern.fm/forum/index.php?topic=16854.msg164500#msg164500
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

Ottoga

  • Member
  • ***
  • Posts: 203
  • The Ox is Slow but the Earth is Patient
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2740 on: March 19, 2016, 01:58:07 AM »
@dfort
Quote
I don't think that's a troll post--the 7D is about the same vintage as the 5D2 so maybe it will work. Of course someone has to be the guinea pig.

I'm happy to be the guinea pig if you can provide the relevant updated modules.
EOS 7D.203, EFS 55-250mm, EF 75-300 III, Tamron 16-300 DiII VC PZD Macro, SpeedLite 580EX II.

Danson Delta-40

  • New to the forum
  • *
  • Posts: 46
  • GOING POSTAL SINCE 1995 - 7D FTW
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2741 on: March 19, 2016, 04:02:58 AM »
I have a 7D. Gimme something to test bruh.
GOING POSTAL SINCE 1995 BABY

dfort

  • Guest
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2742 on: March 19, 2016, 04:34:28 PM »
Ok guinea pigs, someone is going to have to do some investigation where to find these numbers for the 7D.

Code: [Select]
        is_5d2 = 1;                                                                   /*waza57:* For 5D2 distance = 0 , only one register in which doing changes */
        FRAME_CMOS_ISO_START = 0x404b4590; // CMOS register 0000 - for LiveView, ISO 100 (check in movie mode, not photo!)
        FRAME_CMOS_ISO_COUNT =          5; // from ISO 100 to 1600
        FRAME_CMOS_ISO_SIZE  =          0; // distance between ISO 100 and ISO 200 addresses, in bytes

I'm not really sure if there's more to dig up but maybe start a new topic like waza57 did for the 5D2.

Here's the diff so you can see what changes were done to get Dual ISO working on the 5D2:
https://bitbucket.org/daniel_fort/magic-lantern-waza57/branches/compare/waza57/magic-lantern:dual_iso_video_5d2%0Dwaza57/magic-lantern:unified#diff

Walter Schulz

  • Contributor
  • Hero Member
  • *****
  • Posts: 8497
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2743 on: March 19, 2016, 04:43:31 PM »
I'm not really sure if there's more to dig up but maybe start a new topic like waza57 did for the 5D2.

There is an old thread covering Dual ISO in video mode porting to 50D and 7D:
http://www.magiclantern.fm/forum/index.php?topic=13597

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3411
  • 5D3 | M1 | 7D | 70D | SL1 | M2 | 50D
Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2744 on: March 19, 2016, 09:22:58 PM »
Thanks for the friendly reminder @Walter Schulz -- digging this old thread BIG time!

In any case, that cr2hdr I posted is for testing so it looks like you got to be the crash test dummy  :D

I don't have any 5D2 Dual ISO MLV files but the posted tests do look very promising. Maybe the 7D and 50D are next?
It's still online from my earlier post if you would like to play with. I'm also trying to get ahold of my co worker to shoot some more Dual-ISO footage from his 5D2 just to have options for us to troubleshoot this bad boy down.

Isn,t David using his own created dual iso algoritm in MLVFS?
Sean, can you try the same clip with the regular MLP and check for dropped frames?
Ah, well the one thing I'm surprised about is the fact that @dmilligan hasn't updated his cr2hdr binary yet (which I thought was needed in order for 5D2 Dual ISO to work?) however I then ran another test running with just MLVFS and default settings for cr2hdr20-bit and applied Cinelog-C in AE so here's what it looks like...


Also here's the quick comparisons of in between MLP and MLVFS...


@Danne -- I am currently rendering the same test files from 5D2 with the latest MLP from original post of your thread just to see what happens with the random dropped/pinkish frames on both the DNG's and ProRes4444 ... Stand by!

*EDIT*

Just finished spitting out DNG's and ProRes4444 which showed these same 'Green Cast' issues from few days ago BUT no dropping/pinkish frames.


It seems with previous version of cr2hdr which shows green cast and the new compiled cr2hdr version shows random pinkish frames but no green cast ... Weird?

@a1ex -- How exactly can we narrow down the culprit on the latest cr2hdr binary re:5D2?
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109

dfort

  • Guest
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2745 on: March 20, 2016, 01:54:12 AM »
I have built and re-built cr2hdr from the cr2hdr branch on more than one Mac and verified that it keeps tripping up on the same frames from DeafEyeJedi's sample 5D2 files. Has anyone tried to convert these files on Windows or Linux?

DNG's -- https://mega.nz/#F!qgFDVIYY!Qe6XZc8FyVnbM6C4_OtdsA

MLV's -- https://mega.nz/#F!Wo8SDLaR!KD98tGfnzJMHlLy-cllB1A

Does anyone have another short Dual ISO test shot on a 5D2 they can post to see if this is a recurring issue or maybe just something with that one sample?

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2303
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2746 on: March 20, 2016, 02:20:20 AM »
Ok I'll bit  :D
I'll test the mlv & dng's and report back

Does anyone have another short Dual ISO test shot on a 5D2 they can post to see if this is a recurring issue or maybe just something with that one sample?
I can make same Dual ISO from my 5D2 , any thing in particular you would like to see ?

dfort

  • Guest
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2747 on: March 20, 2016, 02:38:09 AM »
I can make same Dual ISO from my 5D2 , any thing in particular you would like to see ?

The file you used for testing is fine as long as it is short enough to upload somewhere.

reddeercity

  • Contributor
  • Hero Member
  • *****
  • Posts: 2303
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2748 on: March 20, 2016, 03:30:16 AM »
Ok , I'll have to make new ones as the other ones are too big 4+GB .
I'll do this shortly.

Also I check out @DeafEyeJedi dual ISO MLV file & no problem , they look right
Extracted with MLVFS for PC & process with BarracudaGUI for CR2HDR (PC) and also process dual iso with MLVFS.
I'll post image later, so I don't think there anything wrong with your new complied CR2HDR at least with PC on windows7 pro

DeafEyeJedi

  • Hero Member
  • *****
  • Posts: 3411
  • 5D3 | M1 | 7D | 70D | SL1 | M2 | 50D
Re: Dual ISO - massive dynamic range improvement (dual_iso.mo)
« Reply #2749 on: March 20, 2016, 05:04:58 AM »
So as it seems ... it's only an issue on the OS X side?

I got few more 5D2 Dual-ISO samples at home.

Currently watching 'Ben-Hur' at the Segerstorm Center for the Arts. Silent film mixed with Symph0ny is quite remarkable!
5D3.113 | 5D3.123 | EOSM.203 | 7D.203 | 70D.112 | 100D.101 | EOSM2.* | 50D.109