Hugin pano/HDR + darktable in scene-referred

Welcome to the forum. Here is some advice I have for you. DT is great at preparing images and matching exposure and color to create tiff files for panorama stitching. Note I do not use the color calibration module for many of my images, because it can make a simple job hard. I am usually happy with the plain old white balance module.

Darktable doesn’t offer panorama stitching. However, DT can prepare the tiff files required for stitching in other programs.

  1. Open the first image
  2. Set white balance if the as shot default is not satisfactory. (I personally am reluctant to use the color calibration module for most images)
  3. Apply denoise (profile)
  4. Sharpen using the preset ‘sharpen demosaicing in the diffuse or sharpen module
  5. Apply the basic colorfullness preset found in the color balance RGB module
  6. Use ‘spot exposure mapping’ controls in the exposure module to set the correct exposure.
    a. Click on the eyedropper attached to the exposure slider
    b. Redraw the area selection box so it covers part of the blue sky (for your images)
    c. Expand the spot exposure mapping options and adjust the position of the lightness slider until a desired exposure result is obtained.
  7. Apply auto tune levels in filmic
  8. Because we are doing panorama stitching apply lens correction to reduce distortion
  9. Apply raw chromatic aberrations module and/or chromatic aberrations module to get rid of fringing if required
  10. Export the image as a 16-bit tiff file
  11. Use Ctrl + Shift+ C to bring up dialog for copying parameters adjusted. Select all parameters and this will be saved to your clipboard
  12. Open your second image
  13. Use the short cut Ctrl + V to paste the settings used from the first image. However, you may need to adjust exposure and filmic if the image does not look identical to your first image. See the next steps.
  14. Use ‘spot exposure mapping’ controls in the exposure module to set the correct exposure.
    a. Click on the eyedropper attached to the exposure slider
    b. Move or redraw the area selection box so it covers part of the blue sky similar to your first image
    c. The position of the lightness slider was set using the first image and the spot exposure mapping will match the exposure of the second image to the first image.
  15. Apply auto tune levels in filmic
  16. Export the image as a 16-bit tiff file
  17. Open the subsequent images and repeat the processes.
  18. The export tiff files are now ready for panorama stitching in Microsoft’s Image Composite Editor (ICE) or any other stitching program. If you have a windows computer ICE is a fantastic free stitching program that matches exposure differences if they exist.

The image doesn’t look like you have followed the instructions, the image should look green.

My workflow of

  1. Do the basic editing to the images and export them as 16 but tiffs
  2. Align the images in Hugin and save the project
  3. For all the images disable all modules except input and output color profile, orientation, noise profile and lens profile, and set the output profile to linear
  4. In Hugin change the image attributes as advices by @flannelhead and stich
  5. Import the output into darktable and check that the input profile is correct
  6. Copy the module stack from one of the source images and enable the disabled modules
  7. Crop and fine-tune

Your steps worked (with small additions)!

Steps 1-9 deviate from first post author who recommends limiting modules to a strict minimum. Is this intentional?

For Step 10 are these sane parameters for 16-bit tiff?

  • uncompressed
  • profile: linear Rec2020 RGB
  • intent: image settings

Hmm not sure where Microsoft ICE comes from… this thread refers to Darktable + Hugin.

Attempt 1:

  • Feature Matching: Hugin’s CPFind + Celeste
  • Optimize geometric: Position (y, p, r)
  • Optimize photometric: Low dynamic range
  • Panorama Output: Exposure corrected, LDR

Yuck! There’s a black distortion on the top-left.

  • Photos > select all + right click > Edit Image Variables > Camera Response > Type > set to Linear (I’m not sure if this did anything)
  • Photos > select all + right click > Reset > Reset User-defined > Color > to one (no color correction) (<- My solution!)
  • Feature Matching: Hugin’s CPFind + Celeste
  • Optimize geometric: Everything (<- I wasn’t sure if the problem was in view/barrel)
  • Optimize photometric: Low dynamic range
  • Panorama Output: Exposure corrected, LDR

100% success!

1 Like

Yes this is intentional. I regard these steps as fundamental for the image processing. Others may have a different opinion.

Forgive me for mentioning ICE. The notes I shared with you are modified from a lesson I teach. I teach the students about ICE because it is an excellent free program for Windows users. I would go to it before Hugin, but that is just my opinion. I saw no harm in mentioning ICE as I had already stated " or any other stitching program", which would include Hugin.

The colour calibration module has some great uses, but with your images I would expect more problems than help from that method. I presume your camera already did a nice white balance, so why create extra work.

Good luck.

1 Like

Is there a quick/efficient way of disabling all of the suggested modules across a large set of images, without having to process each image individually?

I manually disabled the suggested modules in my first image in darkroom, then in lighttable I did a selective copy of the history stack, selecting only the 4 modules which were recommended to be enabled, then selected all the other images and did a selective past of the history stack into them. None of these images (other than the first) turned green; on examination all of them had many modules enabled. Clearly then the elective copy/paste process alters the ‘enabled/disabled’ state of ONLY those modules which were selected in the selective copy step. A module which is enabled in an image is not disabled as a result of a selective paste which does not reference that module.

I tried compressing the history stack to the ‘original’ state in darkroom, but multiple modules were still enabled after this action.

How than can I get a set of images to have only the 4 recommended modules enabled without having to edit each image individually?

First off, I suggest you work on one problem at a time. You can very well stitch jpegs exported from darktable, and they have the advantage that they are compact and fast to load. You could even use half-resolution images for test runs.

If you want to use a very limited number of modules, check first how you apply the history stack on copying: “append” or “overwrite”. You’ll want “overwrite” mode…
And if you need to work with an absolute minimal stack for more than a few images, it might be useful to set the default workflow to “none”. That will only activate those modules that are absolutely essential for displaying the image (that will include white balance, iirc).

But using such a very limited stack means you won’t have “displayable” images on export, so you will need to edit the result of the stitching. To keep maximum quality (which is the whole reason to use Aurélien Pierre’s workflow), you’ll need to export in 16-bit Rec2020. That gives huge TIFFs in my experience…

1 Like

Aha! Back to the drawing board! Thanks for your most valuable guidance.

More importantly, perhaps, you did counsel me: “First off, I suggest you work on one problem at a time.”. Point taken: I’ll revert to simply trying with jpegs to the point where I can correctly drive Hugin to develop a stitched panorama.

I did not tested it, but In the Lightsroom, I would create a style with the required set of modules, and then apply that style to the rest of the pictures in “Overwrite” mode.

What about ghosting management with hugin?
I have a set of bracketed images taken in Florence, Italy, over the Arno river.
There are a couple of boat in the rivere which of course result in ghosting in the final, merged image.
Is there a way to manage that in hugin during the hdr-blending process?

You can use exclude/include masks.

Yes but I don’t understand how they works.

I use them like this:

  • If I have moving objects in the overlapping part of the pano, I exclude them in the picture that adds them.
  • If I have a sharp version of a non-moving object in one image and a blurry version in another image (often on the edge, as my lens isn’t that sharp there), I draw an include mask around the sharper version.

If you exclude objects make sure there is at least one image that can still provide this area, otherwise there will be a hole in the resulting pano.

Tutorial

HTH,
Flössie

1 Like

Ok, I will try.
Thank you!
Only thing, in my case I don’t have a pano but just a “plain” 7 shots bracketing of a single composition, but I don’t think that it would modify the approach to ghosting.

I’m clearly doing something wrong here :sweat_smile:

The only way to make it work is to set the blender to “enblend” using the 2022 version of HUGIN:
immagine

(I’m on ubuntu 22.10 btw)
But I’m not so much satisfied with the blending of the mask I set.
In the crop here it’s clearly visible.
Is there a method to blend it more subtly on the borders?

You have at least two moving parts in your image: the boats and the water. So it’s likely that any mask will be visible in the final result: wherever you have several water layers, you’ll get ghosting in the water. That’s not very objectionable if it’s the same over the whole image, but any local changes in the number of blended layers is likely to be visible.

You don’t say why you had to bracket for that image (nor did you show the complete image), so giving more detailed advice is hard…

1 Like

This is the composition: sunset behind Ponte Vecchio in Florence, Italy. There was a lot of dynamic range in the scene and I want to preserve one frame of the boat in the river without ghosting.
I tried masking other parts of the image to see if there also is some “blend lines” visible and yes, there always are, even on flat colours.
(the image below is a screenshot of the raw file from darktable)
immagine

I think you only need one (long exposure) shot in the sequence for the lower part, so there is no need to mask the boat and water around, and one (short) for the sky.

I was there last week, cannot take the shot again. Also I was handheld (and there was a very strong wind, the tripod would have been useless).
I have to work with these shots.
Anyway, I’d like to know how to manage these kind of situation with ghosting and, also, the long shot couldn’t be able to freeze the boat, which adds some element in the composition.

That screen shot is already quite promising. You’ll have to check in dt where there is sensor clipping, but you may have an image in your stack that is good enough.
“Good enough” will also depend on what use you plan for the image: screen use will have a lot less noise problems than a large print, as you will downsize the image a lot for screen viewing. So you have more leeway in brightening the shadows (here: buildings and water).

If you have to combine images, try with two or three rather far apart in exposure, and without masking (to let hugin do the blending, which in HDR work includes selecting areas of the image). Reason: you have two clear zones in this scene, so one image per zone should get you a decent starting point.

If you really want to see what can be done with this scene, you can always post the raw images as a play-raw, with appropriate licence.

2 Likes