HDR workflow with Hugin


(Brian Innes) #1

I’m looking for some help with regards to the HDR workflow with hugin.

I am trying to stitch a 360x180 degree panorama, using hugin release 2017.0.0.

The base images are bracketed .jpg exposures, which I batch converted to .hdr HDR files using Luminance HDR.

Now hugin loads these without any problem, finds control points etc. However when it comes to showing the panorama preview, in HDR mode, the display has large black areas:

If I try the Panorama Preview in LDR mode, the display is pure black. I have set the HDR and 16 bit display curve in the options to Gamma 2.2

The resulting HDR stitched file, opened into luminance hdr can be seen here, it looks rather dull (I haven’t tone mapped it yet):

Out of interest, I tried stitching the same images, this time using stacks of the original bracketed exposures.

Here is the HDR panorama preview, it looks a much better HDR image.

And the resulting HDR stitched from bracketed exposures exr file opened in luminance hdr

So, to cut a long story short, is it better to feed Hugin the original bracketed exposures, then stitch them using stacks to generate the HDR panorama?

Or is the better method to batch convert the bracketed exposures into hdr images, then use these in Hugin? My computer certainly is happier crunching 32 HDR images in hugin, compared to 96 images in stacks of 3 bracketed exposures. But if using bracketed exposures in hugin with stacks gets better results, then that is what I’ll do.


(Jonas Wagner) #2

Could it be that this is just an exposure issue? It looks like the export from hugin ends at ~-2ev whereas the luminance hdr one goes up to about 0. As for the preview does bumping the exposure/ ev value help? Will clip highlights but might get rid of the back regions.


(Morgan Hardwood) #3

You need to find the answers to several questions to make an informed choice:

  1. Is Hugin’s Panorama Preview window buggy for HDR panoramas?
  2. Does Hugin or Luminance HDR produce buggy HDR files?
  3. Which program handles ghosting better?
  4. Does Hugin handle blending multiple layers of bracketed images as well as it handles a single layer of images?
  5. Do you have enough RAM to load all bracketed images and find control points between them?
  6. Do you have enough RAM to load a stitched HDR panorama (i.e. huge image)?
  7. Do you have enough RAM to tone-map a stitched HDR panorama (i.e. huge image)?
  8. Are you using a global tone-mapping operator or a local one? i.e. if you tone-map a view of the ground, and separately tone-map a view of the sky, will the two views look anything alike and still be stitchable, or will your tone-mapping operator only produce a usable result if used on the already-stitched image?
  9. Do you really want to tone-map, or just enfuse, or manually merge using luminosity masks in GIMP?

The answers will depend on your system, your program versions, your image sizes, your image count, and the time that’s passed since you took your last holiday.


(Brian Innes) #4

I’ve just spotted I uploaded the wrong image for the HDR panorama Preview from the bracketed exposures. I’ll edit my post!

@Jonas_Wagner. That is a good point about it being an exposure issue. Perhaps there is a problem with the way Luminance HDR is creating the HDR files from bracketed exposures?

@Morgan_Hardwood, those are good questions indeed…

I do have 8gb of ram on my system (although 1gb is “used” by the onboard graphics on the AMD APU)

At the moment I haven’t toned mapped any of the HDR images before loading them into hugin.

Perhaps it is an issue with either using HDR input images with Hugin, or an issue with how Luminance HDR creates hdr files from bracketed images… Perhaps I need to try a different tool to create the hdr files from the bracketed images to see if that changes anything.

Or as you say could there be an issue with the Hugin Panorama Preview for HDR panoramas. It’d be interesting to see if anyone else is having similar issues.

My plan is to just do a global tone map on the final stitched image.


(Karl) #5

I’ve experienced issues like your preview when using .hdr files exported from LuminanceHDR. Saving to EXR (with a recent version of OpenEXR) solved this for me.

My typical workflow is to export to HDR first, then stitch with Hugin (exactly as you’re trying to do.) I only work with original images in Hugin if I’m going to do exposure fusion, or there was camera movement within my stacks.


(Brian Innes) #6

@Karl, are you able to batch convert bracketed exposures into exr files using openexr? If not, how do you achieve this?


(Karl) #7

@Brian_Innes - sorry if I wasn’t clear - the part in parenthesis means using a version of LuminanceHDR that’s been compiled against a recent (2.2?) version of the OpenEXR library.

ie. use LuminanceHDR as you normally would, but save to EXR (.exr) instead of Radiance (.hdr).


(Brian Innes) #8

@Karl, thanks for the reply. I will try batch processing the bracketed jpg images, using Luminance HDR 2.5.1, but save them as .exr files rather than .hdr

Then I’ll try modifying the .pto file to load the .exr files rather than the .hdr rather than starting the panorama from scratch. I’ll be sure to let you know how I get on.

:slight_smile:


(Mica) #9

You can also share the files with us and we’ll take a crack at processing them and report back :slight_smile:


(Brian Innes) #10

It looks like using EXR files as input to hugin is working, it stitches and produces an hdr panorama.

Only slight issue is I seem to have some issues with the seam blending:

It seems that hugin crashes whenever I try doing photometric optimisation using exr input files. (hugin version 2017.1.0.66dc0e99db04 on Ubuntu Mate 17.04)

@paperdigits, if I was to upload the .jpg files from the camera (only some of them, not the entire 100 for the full 360x180 panorama!), where would be the best place to do so? It would certainly be interesting to see if anyone else has issues with working with hdr images in hugin.

At the moment hugin is working away on a selection of the .jpgs from the camera (bracketed exposures), stitching them as stacks into a hdr panorama. I’m leaning towards just using stacks with the bracketed images, as it seems to be one less processing step to do, batch converting the bracketed exposures into hdr images.

I’ll put up an image of the resulting stitch once it finishes.


(Mica) #11

filebin.net if you want to zip all of them!


(Brian Innes) #12

@paperdigits here is the filebin.net location: https://filebin.net/baznnfzxozwtpvu4/IMGP2287-2310.zip

I’ve zipped up the bracketed exposures (3 per bracket) for the middle row of the panorama.

Hopefully this will work OK.

It’ll be interesting to see if you get different results.


(Mica) #13

I can give it a go tonight! I’m on the west coast of the US :slight_smile:


(Brian Innes) #14

@paperdigits, thank you!

The actual location is of the Forth Rail Bridge, at North Queesnsferry, Scotland. :slight_smile:


(Mica) #15

Very cool! I’ve been trying to better my hugin skills, sonim looking forward to it.


(Mica) #16

I did this without making exr files first, just letting hugin align each image, then stitch the panorama. Still quite a few artifacts in the stitch, but I think it shows how well hugin can exposure blend the images. If I can find more time, I’ll blend each shot, then stitch in a separate project.


(Brian Innes) #17

Thanks for that @paperdigits! Perhaps I am overcomplicating things by trying to work in HDR, where using enfused images for the input might be easier…


(Mica) #18

I’ve always found the exposure fusing provides a pleasing result that is fairly natural looking.


(Brian Innes) #19

@Morgan_Hardwood, I certainly notice Hugin is a lot faster and happier working on a single layer of images, rather than stacked exposures.


(Brian Innes) #20

A bit of an update.

After much head scratching, and inspired by @paperdigits results above, I started with a fresh canvas, so to speak, and started with a new hugin project.

I loaded up the bracketed .jpgs, set them into stacks of three, then I let hugin do it’s thing.

Prior to carrying out photometric optimisation for High Dynamic Range, Fixed exposure, I reset the Ev values of the base images to the exif values.

Initial tests, and hugin is stitching a beautiful enfused image:

The stitched HDR image is pretty much perfect as well.

Now I’m not sure what has caused my previous issues. Perhaps it is an problem with the way Luminance HDR creates HDR /EXR files from bracketed jpgs?

One thing I think I did wrong on my behalf was to do photometric optimisation for High Dynamic Range, variable white balance, fixed exposure rather than High Dynamic range with fixed exposure. The camera had been set to a fixed white balance during the shoot.

I certainly think that working with stacked bracketed images seems to work better.

Fingers crossed it’ll still work when I start adding all 100 odd images to do the 360x180 panorama!