jcelaya / hdrmerge

HDR exposure merging
http://jcelaya.github.io/hdrmerge/
Other
362 stars 78 forks source link

Constant exposure #37

Closed Beep6581 closed 6 years ago

Beep6581 commented 10 years ago

When I shoot 360° panoramas I do so on manual mode with bracketing, e.g. a bracketed set of 5 images every 60°, so 6x5 . The files produced by HDRMerge however differ in their average exposure - some need a +1EV boost in RawTherapee, others need even +4EV. Would it be possible to lock a constant exposure so that a common point visible in several or all of the resulting HDR DNG images, such as a floor tile, has the same brightness?

jcelaya commented 10 years ago

I don't think that is possible. Mainly because the output is raw: it is linear and not interpolated. So, I can only increase brightness by multiplying all the values by a certain factor, which would clip the highlights. RawTherapee can recover these highlights, or apply other techniques that increase the brightness without clipping them; HDRMerge cannot.

There is also another problem. To lock the exposure, I should be able to measure the absolute luminance of the images, and that is also very difficult, not even possible in some cases.

Beep6581 commented 10 years ago

Sorry to be a pain, but I wanted to bump this as it is a really big problem when shooting panoramas (which is what I mainly do). The problem is that after merging, the carefully set up brackets simply don't fit well together for stitching. I can manually try and get exposures similar when working with 4 or 6 shots, but when working with 30 shots or more this becomes impossible. What can we do about this?

Is there anything at all, any dirty trick or even slow scan of all input files HDRMerge could do, to end up with the batch of merged where the exposure is constant? Maybe use the darkest shot as an anchor (even if no part of it is used)?

jcelaya commented 10 years ago

Let's see, I think you are trying to solve a problem that is not related to HDRMerge. It should be down later in your workflow. So, explain me what is your workflow. Should be something like:

That problem you have with the exposures is usually solved by the panorama stitcher. Suppose this simple situation: you take 2 shots in a room with a window. First shot to the window, second shot to the wall next to it. You expose both shots correctly, which means that in the second shot, the wall will be lighter than in the first, due to the difference of lighting conditions. Then, your panorama stitcher should adjust gradually the difference of exposure between them to stitch them together seamlessly.

So, why is your software not doing this? What program are you using, exactly? What is your workflow?

Beep6581 commented 10 years ago

Thank you for looking into it.

Yes, that is my workflow. Though panorama stitchers are able to compensate for variations in exposure, the SISO principle "shit in = shit out" remains valid. Even though I use one of the best panorama stitchers (Autopano Giga), for high quality professional results the photographer must shoot in manual mode, constant exposure and white balance. Furthermore, with a floating average exposure, there are some issues which happen at the RT stage and are impossible to compensate for later by the panorama stitcher. For example if I would like to do color toning in RawTherapee then I rely on the fact that photos all around are at a constant exposure, so if I would like the dark tones to tint blue and the light tones to tint gold, then it would be impossible to paste this profile to other photos and have them tinted correctly, let alone blend correctly. Same for noise reduction which targets lighter tones differently than darker tones (via the gamma slider), etc. HDRMerge's output varies not by an insignificant 0.3EV but by a massive 5EV or even more! If I could lock HDRMerge's output exposure, for example to depend on the darkest of the source images, then all the problems would go away - I could set exposure compensation as required and use any tool in RT and paste this profile to the other photos and they would all look correct and blend/stitch well.

Please take a look at these screenshots which demonstrate the issue quite well: The source images, bracketed in manual mode: http://i.imgur.com/NvF9rKN.jpg If I was to stitch using the middle image from each bracketed set, I'd get a perfect stitch: http://i.imgur.com/0L87foB.png Now these are the resulting DNGs from HDRMerge with the Neutral profile: http://i.imgur.com/ZW8MwHo.jpg There is over 5EV difference between these two: http://i.imgur.com/2R9lZXt.png http://i.imgur.com/udE7hrd.png Which means the effects of some tools will differ wildly. These three have the same PP3 applied: http://i.imgur.com/FThYuFK.png And they will not stitch well: http://i.imgur.com/lw5z4Ms.png http://i.imgur.com/Q1cQo0Q.png http://i.imgur.com/gzkoac6.png http://i.imgur.com/LMm7Nxc.png Not even with the neutral profile: http://i.imgur.com/ZrzpNGP.png

Now if I first manually adjust the exposures as best I can in RawTherapee (though this is difficult and takes a lot of time), and then use other tools on top of that, then I can end up with something usable: http://i.imgur.com/9dUNX0H.png http://i.imgur.com/B8FFlkd.png

Beep6581 commented 10 years ago

Hi! I have been away for the last ten days. I was wondering if you had time to look at this issue, if there is any hope around the corner?

jcelaya commented 10 years ago

Hi, I am very busy these days. I can dedicate no time to HDRMerge :( But in some days I will return to this problem again, don't loose hope!

Javi

2014-08-01 0:43 GMT+02:00 Beep6581 notifications@github.com:

Hi! I have been away for the last ten days. I was wondering if you had time to look at this issue, if there is any hope around the corner?

— Reply to this email directly or view it on GitHub https://github.com/jcelaya/hdrmerge/issues/37#issuecomment-50828590.

Beep6581 commented 10 years ago

Great to hear! Then I'll keep my shots on hold, hopefully I can get better results then :)

jcelaya commented 10 years ago

I've been thinking about this problem. I think I could adjust the absolute exposure of a batch of images to be (nearly) the same.

Beep6581 commented 10 years ago

Perfect! Can't wait :) In the meanwhile I'll continue battling to manually match exposures, already did two panoramas today :) Here's a work-in-progress: http://imgur.com/xCpL2xz

Beep6581 commented 10 years ago

Hi, sorry to bother you. Any news?

jcelaya commented 10 years ago

Hi, it's going to take me a while... I have very little time now, and I want to fix a couple of bugs before adding more functionalities.

Beep6581 commented 10 years ago

Hi ;) Any luck yet?

jcelaya commented 10 years ago

Nope

Beep6581 commented 9 years ago

I wrote a haiku: cd code, git pull, enter constant exposure, such excitement, dreams come true! aww, "Already up-to-date." ;]

jcelaya commented 9 years ago

Nice... unfortunately, I cannot go any faster :(

jcelaya commented 9 years ago

OK, I'm focusing on this right now. Can you send me a sample set where you have raws with very different exposures? Like the set of raw images that you used to create the panorama you linked some messages above.

Beep6581 commented 9 years ago

I am very happy to hear that! :) I will get right on it.

Beep6581 commented 9 years ago

Unfortunately I don't have the old PEFs, but here are some new cases tested using today's develop branch.

http://filebin.net/ydx8jjm2e6 3 stop difference between 131-135 and 136-140.

Beep6581 commented 9 years ago

I'm uploading more files to that tag. I hope they're all OK, as while uploading 159-168 my laptop reset, so I uploaded them again. Just run HDRMerge in batch mode over the folder with these raws, then you'll see the exposure differences in the RT file browser. I use these settings: ~/programs/hdrmerge-develop/hdrmerge -B -b 16 --no-align --no-crop -p half *.pef

Beep6581 commented 9 years ago

Also it happened three times now that the current develop branch created pitch-black DNG file, even with +10EV in RT. For an example, see 2014-03-08_soderasens_1_32-36.pef (uploading, ready in 10 minutes).

jcelaya commented 9 years ago

This last problem may have been fixed at the same time as issue #50

Beep6581 commented 9 years ago

Yes that seems to have fixed it too :)

I wanted to clarify what I mean by constant exposure. I don't expect any automated calculations to get a similar point between two shots to match in exposure if the overall dynamic range of both shots varies greatly, e.g. one stack of shots of the interior of a room with just low dynamic range walls, and the adjacent stack showing a common piece of wall and a window with a bright sunny day outside. Matching them would require finding similar control points and comparing them, which I know is outside the scope of what HDRMerge does. However what would be extremely useful and I think possible was if the resulting exposure of the DNGs was the same since the two adjacent stacks were taken using the same camera settings. So they both were built from one shot at say 1/1000s, one at 1/250s, one at 1/80s. Even if their dynamic range varies greatly, a common point on a wall should have the same exposure between the two shots. Maybe HDRMerge could rely on the Exif info to position the histogram of the final DNG such that this is preserved.

jcelaya commented 9 years ago

Yes, my plan was to rely on the Exif information. At least we will get a nearly-constant exposure among the results. It won't be difficult... as soon as I find some time

Blizzara commented 7 years ago

Hi! I asumme this was never implemented? At least I think I hit the same problem. I'm thinking of trying to implement this myself, so I was wondering if you @jcelaya had some concrete idea on how to do this?

jcelaya commented 7 years ago

Maybe you can go through all the images on a first run, find the most exposed one, and use it to scale down all the DNGs in relation to their apperture/speed/ISO. I don't see an obvious solution here.