Why does hugin change exposure?

177 views
Skip to first unread message

Frederic Da Vitoria

unread,
Dec 6, 2024, 3:04:50 AM12/6/24
to hugin and other free panoramic software
Hello,

When I dragged the 3 pictures into Hugin, it warned me that "The project covers a big brightness range (...)", which is true. I proceeded as usual: create control points, optimize and output to layered TIFF. I did not ask Hugin to optimize photometric parameters, as I prefer to do the optimization myself in Gimp. The third photo is obviously lighter in the panorama than the original (and on looking closely, the first photo is slightly darker, but this does not bother me so much as the amount of correction here is small).

I tried everything I could think of, but the only way I could get a panorama close to the originals was by asking Hugin to optimize photometric parameters, which is something I don't want him to do.

Can someone tell me what is going on and how I can get a panorama with photometric parameters identical to the source photos?







Bruno Postle

unread,
Dec 6, 2024, 5:43:41 AM12/6/24
to hugi...@googlegroups.com
On Fri, 6 Dec 2024 at 08:04, Frederic Da Vitoria wrote:
Hello,

When I dragged the 3 pictures into Hugin, it warned me that "The project covers a big brightness range (...)", which is true. I proceeded as usual: create control points, optimize and output to layered TIFF. I did not ask Hugin to optimize photometric parameters, as I prefer to do the optimization myself in Gimp. The third photo is obviously lighter in the panorama than the original (and on looking closely, the first photo is slightly darker, but this does not bother me so much as the amount of correction here is small).

I tried everything I could think of, but the only way I could get a panorama close to the originals was by asking Hugin to optimize photometric parameters, which is something I don't want him to do.

Can someone tell me what is going on and how I can get a panorama with photometric parameters identical to the source photos?

Hugin reads the EXIF metadata and adjusts the exposure of each photo in the project so they all look like they were taken with the same exposure. Sometimes this works very well, but it can result in ugly blown out areas depending on your camera.

This adjustment happens when you initially add the photos, when you optimise the Ev these values will change slightly, but probably not much.

If you don't want this behaviour, the simplest thing you can do is to set the Ev of all your input photos *and* the Ev of your panorama output to the same number. I also find that increasing the enblend levels helps cover the mismatch.

--
Bruno

Abrimaal

unread,
Dec 6, 2024, 9:03:50 PM12/6/24
to hugin and other free panoramic software
There are a few ways, options in the panorama editor that give you more control over the final panoramas.

First make a panorama with automatic exposure correction, then save a new .pto file, reset user defined parameters - exposure, color, vignetting - whatever you want (but do not change positions, projection, size, crop), make new panoramas. At last select all photos, reset photometric parameters and make one more panorama. See which one looks the best.

You can also start from loading photos, then go to the panorama editor, find control points, vertical lines, optimize positions and save the panorama without exposure and color correction.

You will probably see that one panorama looks better in darker tones, the other in brighter areas. One panorama has better colors, the other has better exposures.
Now you may load all panoramas to Hugin,
reset positions, set projection to rectilinear.
select the best parts using "include" and "exclude" masks, then save panoramas from stacks and from any arrangement,
but... there may be parts that are differently aligned - the panorama made from stacks will contain overlaying objects in different places. In this case there should be an "include" mask for these differently aligned parts.

Well, it works when you have only one panorama on your computer and unlimited time...

I have started these topics, that the developers could introduce:
- exposure correction as an optional step (in the settings)
- select a different photo for exposure and a different photo for color.
but this was not introduced, as many other ideas.
some examples:
a dark UI theme - adding control points in night photos is almost impossible, 
horizontal lines detection - for making rectilinear textures from buildings, 
short, user defined suffixes instead of _fused and _blended_fused - if you blend panoramas multiple times, you can get such filenames _fused_blended_fused_blended_fused_fused
I even tried to replace the strings in the files, but there are hundreds of files, the suffixes _blended_fused and _fused are not a text variable, defined once, only in one file. They are repeated in multiple files as plain text.
Well, I see that the whole construction became too complex, even for the leading developers.
Whatever, glory to them, that it still works and it is still a free software.

David W. Jones

unread,
Dec 6, 2024, 9:31:44 PM12/6/24
to hugi...@googlegroups.com
> horizontal lines detection - for making rectilinear textures from buildings

Yes, please! Very useful for sea horizons, too, or the American Great Plains.

Hugin can detect vertical lines. It makes no sense to me that the same process can't detect horizontal lines, too!

I've tried this:
1. Rotate all images in an external editor, so horizons become vertical.
2. Put them in a panorama and search for vertical lines. Successfully get lines on horizons.
3. Save and close panorama.
4. Externally rotate images back to original orientation.
5. Re-open panorama.

Then twiddle vertical lines to horizontal, drag start/end points around, etc. I've also tried editing the PTO file to change line orientation, but that still requires twiddling end points.

I'd think you could somehow map original end points to their rotated but I can't figure out the math to rotate lines and re-map changed end points.

Ideas?

--
David W. Jones
gnome...@gmail.com
exploring the landscape of god
http://dancingtreefrog.com

Sent from my Android device with F/LOSS K-9 Mail.

David W. Jones

unread,
Dec 7, 2024, 1:47:27 AM12/7/24
to hugi...@googlegroups.com
How does this affect making exposure stacks? In that case, I'd expect Hugin to use the EXIF EV instead of adjusting the exposures of individual images "out of the box".

Bruno Postle

unread,
Dec 7, 2024, 4:52:40 AM12/7/24
to hugi...@googlegroups.com
On Sat, 7 Dec 2024 at 06:47, David W. Jones wrote:
>
> On December 6, 2024 12:43:19 AM HST, Bruno Postle wrote:
> > Hugin reads the EXIF metadata and adjusts the exposure of each photo in the
> > project so they all look like they were taken with the same exposure.
> > Sometimes this works very well, but it can result in ugly blown out areas
> > depending on your camera.
>
> > If you don't want this behaviour, the simplest thing you can do is to set
> > the Ev of all your input photos *and* the Ev of your panorama output to the
> > same number. I also find that increasing the enblend levels helps cover the
> > mismatch.
>
> How does this affect making exposure stacks? In that case, I'd expect Hugin to use the EXIF EV instead of adjusting the exposures of individual images "out of the box".

Camera EXIV EV values can be unreliable, my Nikon shutter speeds are
not to be trusted, even on consecutive shots. The difference between
relying on EXIV data and optimisation is usually very noticeable, even
with a panorama shot on fixed exposure.

Also the vignetting/exposure/response-curve optimisation works best
when used together. HDR exposure stacks rely completely on a good
response-curve calculation.

Hugin by default tries to create a photometrically accurate panorama.
Even if the camera is on auto-exposure the rendered result will be as
if it was taken on with a single exposure - most of the time this is
what you want, I leave my phone camera on auto-exposure, and stitch
with Hugin on default settings.

If you still want to avoid this exposure correction, another way to do
it is to stitch using one of the 'Exposure fused' panorama output
options. This is designed for stacked panoramas, but it also works on
normal panoramas with partial overlap - exposure fusion is not in any
way photometrically accurate so exposure correcting photos would be
counterproductive.

--
Bruno

Bruno Postle

unread,
Dec 7, 2024, 5:23:45 AM12/7/24
to hugi...@googlegroups.com
On Sat, 7 Dec 2024 at 02:03, Abrimaal wrote:
>
> I have started these topics, that the developers could introduce:
> - exposure correction as an optional step (in the settings)

See my last email, you can also stitch using one of the 'Exposure fused' panorama output options.

> - select a different photo for exposure and a different photo for color.

Have you tried the Grey picker in the preview? I find I can almost always find a good colour balance with this.

> a dark UI theme - adding control points in night photos is almost impossible,

Dark UI? This works fine for me:

Screenshot from 2024-12-07 09-56-38.png
Screenshot from 2024-12-07 10-18-41.png

> horizontal lines detection - for making rectilinear textures from buildings,

Probably a patch would be accepted - so long as it is written so that a beginner would never find this option - horizontal control points are only useful in a very small range of situations.

> short, user defined suffixes instead of _fused and _blended_fused - if you blend panoramas multiple times, you can get such filenames _fused_blended_fused_blended_fused_fused

You need to look in the code to see how easy this is to implement, if these suffixes are hard-coded in multiple locations then this sort of change without lots of testing has the potential to break badly.

--
Bruno

Jun Chen

unread,
Dec 27, 2024, 3:42:35 AM12/27/24
to hugin and other free panoramic software

Jun Chen

unread,
Dec 27, 2024, 3:42:35 AM12/27/24
to hugin and other free panoramic software
# Project Name  
Image Stitching on Mobile with Hugin  

## Introduction  
This project brings Hugin's image stitching capabilities to mobile platforms, enabling panorama creation directly on Android devices. By porting the Hugin project to Android, users can stitch multiple images into a panoramic image on their phones.  

## Features  
- **Image Capture**: Use the Kuntu mobile panoramic gimbal to capture aligned images as stitching input.  
- **Seamless Stitching**: Import captured images into the app and create panoramic images directly on mobile devices.  

[![Gimbal](pic/1.png)](https://kuntu720.taobao.com)  <br>
[![Gimbal](pic/2.png)](https://kuntu720.taobao.com)  <br>

#### Source Images  
![Source Images](pic/imges.png)  <br>

#### Stitching Result  
![Stitching Result](pic/reslut.jpg)  <br>

### Installation Steps  
1. Clone the repository:  
   ```bash  

References<br>


# 项目名称
利用hugin实现移动端图片拼接

## 简介
利用hugin实现移动端图片拼接,基于android平台,把hugin项目移植到安卓平台实现图片拼接成全景图

## 功能特点
素材采集采用鲲图手机全景云台对素材采集,然后把素材导入项目实现移动端完成全景图拼接
[![云台](pic/1.png)](https://kuntu720.taobao.com)<br>
[![云台](pic/2.png)](https://kuntu720.taobao.com)<br>
[![素材](pic/imges.png)]<br>
[![拼接结果](pic/reslut.jpg)]<br>


### 安装步骤
1. 克隆仓库:
   ```bash

## 引用

Reply all
Reply to author
Forward
0 new messages