Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash with Fuji DR RAF #165

Closed
Floessie opened this issue Sep 22, 2018 · 27 comments
Closed

Crash with Fuji DR RAF #165

Floessie opened this issue Sep 22, 2018 · 27 comments

Comments

@Floessie
Copy link
Contributor

Hi,

I was about to develop a RAF from my F600EXR in RT when to my surprise I learned that it contains two subframes, because it was taken in "Dynamic Range" mode. Thus, I fired up HDRMerge (master) to see if it would try to combine the frames. Unfortunately, I couldn't find it out, as it crashes immediately.

So here's the file in the hope that you can figure out what makes it so special. 😉

Best,
Flössie

@heckflosse
Copy link
Collaborator

@Floessie Currently HDRMerge supports only files with one or three frames. But it should be easy to support two frames now as there is an example file available... Just try it ;-)

https://github.com/jcelaya/hdrmerge/blob/master/src/ImageIO.cpp#L98

@heckflosse
Copy link
Collaborator

heckflosse commented Sep 22, 2018

@Floessie The exr cameras also have a mode where the exposure of both frames is equal. In this case one can just combine them in RT (after adding some lines of code of course).

Here's an example. Left is one frame, right is combination of both frames. Much less noise
grafik

If you're interested, please open an issue in RawTherapee. The engine code is easy...

@Floessie
Copy link
Contributor Author

@heckflosse Splendid! Ingo, thanks a lot. Fix confirmed, RAF developed, all fine! 👍

The exr cameras also have a mode where the exposure of both frames is equal. In this case one can just combine them in RT (after adding some lines of code of course).

I think you mean the SN mode ("Signal/Noise"). Yes, I sometimes use it and would be a beneficiary. I have to dig through my archive to find such a RAF...

@heckflosse
Copy link
Collaborator

@Floessie All exr RAF which are not made in DR mode should contain 2 frames with equal exposure.

@Floessie
Copy link
Contributor Author

@heckflosse There are three modes: DR, SN and HR (which I never use). So even HR should contain two frames?

@heckflosse
Copy link
Collaborator

@Floessie exactly

@Floessie
Copy link
Contributor Author

@heckflosse I coincidentally have a stack (-1, 0, +1 EV) of DR RAFs, and had expected them to show up with six frames, now that you kindly fixed the DR case, but only got three. Wouldn't that be beneficial, to get the most out of the stack?

I tried to work around it, by first merging the single DR shots and then combining the stack, but HDRMerge won't let me load its own DNGs.

@Beep6581
Copy link
Collaborator

All exr RAF which are not made in DR mode should contain 2 frames with equal exposure.

I wanted to point out #60

@LigH-de
Copy link

LigH-de commented Aug 5, 2019

@heckflosse - it seems that not all EXR cameras produce the same kind of RAF file content. I have a Fujifilm FinePix S200EXR and took a triple shot in different explicit EXR modes. The results are as follows:

  • HR: 24.12 MB, dcraw reports 2 images with 2824×2128 px, Lightroom can reconstruct 4000×3000 px
  • SN: 12.43 MB, dcraw reports 1 image with 2824×2128 px, Lightroom can reconstruct 2816×2112 px
  • DR: 12.43 MB, dcraw reports 1 image with 2824×2128 px, Lightroom can reconstruct 2816×2112 px

So I guess there is the following content:

  • HR: two separate raw images, diagonally interleaved, the high-res result is interpolated (and only Fujifilm and Adobe know how)
  • SN: one raw image which already contains an average image of the binned sensor pixel pairs
  • DR: one raw image which already contains a HDR image of the differently exposed sensor pixel pairs

Check them yourself.

A pity the example provided by @Floessie already expired. So I can't compare.

@heckflosse
Copy link
Collaborator

@LigH-de
You can use this file for tests.

It contains two frames with different exposure.

@LigH-de
Copy link

LigH-de commented Aug 6, 2019

OK, my mistake ... the camera stores two separate frames in the RAF only if it detects a sufficient contrast. Even if you force a specific contrast mode, the motive may still fit in the value range of only one frame.

@heckflosse
Copy link
Collaborator

@LigH-de

the camera stores two separate frames in the RAF only if it detects a sufficient contrast. Even if you force a specific contrast mode, the motive may still fit in the value range of only one frame.

Interesting and good to know 👍

@LigH-de
Copy link

LigH-de commented Aug 8, 2019

If you are curious, a few more EXR-DR samples

Naming scheme:

EXR-DR_Axxxx_Dyyy.RAF with xxxx = "Auto sensitivity up to xxxx ISO" and yyy = "Dynamic range up to yyy%", according to the camera menu.

You will notice that the contrast was moderate so that the 200% DR shot fit in only one raw frame.

@LigH-de
Copy link

LigH-de commented Aug 11, 2019

I went out today and shot several photos with high dynamic range. Hope you can use a few to improve handling of 2 frame raw images.

MediaFire: EXR-DR

BTW, I missed a guide how to use them correctly: Do I open one, or do I have to add a second copy? Without a copy, the preview is only green (1 layer), blue areas (layer 2) only appear with a stack of 2 times the dual frame RAF.

@LigH-de
Copy link

LigH-de commented Sep 23, 2019

As suggested by @heckflosse I started HDRMerge 0.5 as hdrmerge.exe -vv and opened a RAF file. Upon closing the application, I got an APPCRASH dialog.

@heckflosse
Copy link
Collaborator

@LigH-de I also suggested to post the output. I meant what's written in console.

@LigH-de
Copy link

LigH-de commented Sep 23, 2019

The GUI version (hdrmerge.exe) wrote nothing on the console.

I tried the CLI version too:

hdrmerge.com -vv -a --single DSCF4758.RAF
[  0%] Loading DSCF4758.RAF
DSCF4758.RAF: 2824x2128 (2880x2128+28+0, by Fujifilm S200EXR, 100ISO 1/67.6492sec f3.4822 EV:-9.68
b4b4b4b4 RGBG, sat 16383, black 512, flip 0, wb: 667 336 615 336, cblack: 512 512 512 512
Load files: 0.105006 seconds
[ 50%] Aligning
Compute response functions: 0 seconds
Generate mask: 0.013001 seconds
[100%] Done loading!
Writing result to K:/PICs/private/EXR-Modi/EXR-DR/DSCF4758.dng
Writing K:/PICs/private/EXR-Modi/EXR-DR/DSCF4758.dng, 16-bit, 2824x2128
[  0%] Rendering image
Adjusted white balance: 1.98512 1 1.83036 1
Fatten mask: 0.033002 seconds
Blur: 0.17901 seconds
Compose: 0.065004 seconds
[ 33%] Rendering preview
Render preview: 4.35725 seconds
[ 66%] Writing output
Write output: 0.392022 seconds
[100%] Done writing!

@heckflosse
Copy link
Collaborator

Did you start it from console?

@LigH-de
Copy link

LigH-de commented Sep 23, 2019

Yes, I started the GUI version in a console.

@heckflosse
Copy link
Collaborator

Ok, HDRMerge found only one frame. Nothing we can do about that, as we get the number of frames from libraw.

@heckflosse
Copy link
Collaborator

Yes, I started the GUI version in a console.

Ah, ok, you're on windows. There console output from gui version might not work :(

@LigH-de
Copy link

LigH-de commented Sep 23, 2019

Well, you have plenty of test files in these archives.

I remember that PlaneShift (an OpenSource multi-platform game) has similar issues that consoles don't work the same way in Linux and Windows. Here you may use DebugView messages as an alternative way to communicate with a developer. Or you would have to design your application as CLI type anyway and hand-weave the whole window handling.

@LigH-de
Copy link

LigH-de commented Sep 23, 2019

Ok, HDRMerge found only one frame. Nothing we can do about that, as we get the number of frames from libraw.

Nothing ... except maybe helping to improve libraw.

@heckflosse
Copy link
Collaborator

For the Windows console thing we could use the code from RT where it works fine...

@LigH-de
Copy link

LigH-de commented Sep 24, 2019

Is there any more recent test version you can point at? If not, I may have to try if I can build it in MSYS2/MinGW.

@LigH-de
Copy link

LigH-de commented Sep 24, 2019

Now this version seems to work as expected. I see green and blue layer areas covering the image about 50:50. And the DNG looks quite credible in RawTherapee 5.7.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants