Automatizing the process

245 views
Skip to first unread message

Abrimaal

unread,
Dec 6, 2024, 10:03:52 PM12/6/24
to hugin and other free panoramic software
There were already many topics about batch stitching of multiple panoramas.
Almost all of them required programming skills.
Photographers are a different species than programmers. We don't understand these numeric values. We think with images, not with numbers.

I use also Bimostitch on Android (the last working version 2.13). It allows to load even a hundred of photos, it detects when a new panorama begins (sometimes with errors, but usually it does the work correctly).
Not aligned photos are automatically discarded.
The user previews all panoramas before stitching, sets projection, color and exposure correction, blending mode and strength. Then the user presses "go" button and the app does its work.
Sounds improbably?
Yes, because the app does not store filenames!
Every panorama is saved with a current date, ignoring the original filenames and even EXiF data.
So, after a hour of the app work, the user spends a few hours to find photos, copy and paste filenames.
The developer is deaf for that.

For Hugin automatic processing, the initial work belongs to the user.

User:
Move all partial photos to one folder
Add words "end" "split" to filenames.
"End" means that this is the last image, that is included to load.
"Split" means that the image is not loaded - I always take a photo of my hand, of the ground or sky, to separate panoramas.
Hugin will not detect a hand in a photo, we don't even want it.
This is why the filenames contain commands, where the panorama ends.
Some filenames may already contain such words as "end" or "split", not related to the commands. (the end of the splitting road, for example).
So, the commands should be unique strings that are not commonly used in (at least English) language.
Any suggestions? !e! !s! - commands: end or split. May it be this way?

The filenames may also contain other commands: projection for example (the user has to read the document, and learn what commands and parameters are used in Hugin).

Hugin batch processor:
Reads the filenames. If a command to split found,
load image set, align,
+ auto discard unaligned images
save .pto, save panorama
Loop, process the next image set.

Can we make it possible?

This is an example folder containing images ending with commands !e! - the last image for a panorama.
The folder contains also single unrelated images, cars, cats, but
- the user should move them from this folder
or / and
- hugin automatically discards unaligned images

commands in filenames.jpg




Harry van der Wolf

unread,
Dec 7, 2024, 4:56:48 AM12/7/24
to hugi...@googlegroups.com
Did you ever look at XPano?

Op za 7 dec 2024 om 04:03 schreef Abrimaal <abri...@wp.pl>:
--
A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
---
You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/hugin-ptx/1975cc3f-c567-446e-97b0-95b590595c7en%40googlegroups.com.

T. Modes

unread,
Dec 7, 2024, 5:19:43 AM12/7/24
to hugin and other free panoramic software
PTBatcherGUI has already a function to search for panoramas in folders based on the EXIF data. (File>Search directory for >Images)
This works fine for me for images straight from the camera.
Maybe it needs some fine-tuning of the settings for your work flow.

Abrimaal

unread,
Jan 4, 2025, 9:09:40 PMJan 4
to hugin and other free panoramic software
Wow, this is a huge step ahead.
The project files have been saved to the folder.

Now, I want to learn how to control hugin (and associated apps) from a script.
in an "example basic language" it would be this way.

1 For all *.pto in FOLDER
2 Open .pto
3 set projection=mercator, find control points (Hugin CPFind+celeste), find vertical lines
4 remove unaligned images
5 fine tune all points
6 optimize positions and view
7 center image
8 crop
9 save .pto
10 Next .pto

or simpler, but less control

1 For all *.pto in FOLDER
2 Open .pto
3 Align
4 Remove unaligned images
5 save .pto
6 Next .pto

when .pto are saved, I can run the batch processor.
commands:
1 make all panoramas using "exposure corrected" (no blended, fused)
2 delete all *.log (if any fails)

I have noticed that some panoramas have been created, 
when I opened the first project in hugin and clicked "create panorama", it started batch processing all projects in the queue.

But I don't know how to run the Batch Process from the Batch Processor. :)

Some panoramas = these that did not contain unaligned images.

I am especially uncertain how to auto-remove unaligned images from projects. 
These images may contain control points = vertical lines, but these images are not matched.

Unaligned image types
unsuccessful photos (sometimes happen)
separators (any photo to separate panoramas taken one after one)

unaligned image types = unsuccessful and separators.jpg

Greg 'groggy' Lehey

unread,
Jan 5, 2025, 8:09:22 PMJan 5
to hugi...@googlegroups.com
On Saturday, 4 January 2025 at 18:09:40 -0800, Abrimaal wrote:
> Wow, this is a huge step ahead.
> The project files have been saved to the folder.
>
> Now, I want to learn how to control hugin (and associated apps) from a
> script.
> in an "example basic language" it would be this way.
>
> 1 For all *.pto in FOLDER ...

I do something similar. This part corresponds to the scripts
http://www.lemis.com/grog/src/mkpto and
http://wwww.lemis.com/grog/src/mkpto1

They won't work for you, because they rely on my directory layout and
file naming, but if you find them interesting, I can answer any
questions.

One missing program is 'by', which parallelizes the conversions.
xargs has a similar option.

Greg
--
Sent from my desktop computer.
Finger groo...@gmail.com for PGP public key.
See complete headers for address and phone numbers.
This message is digitally signed. If your Microsoft mail program
reports problems, please read http://lemis.com/broken-MUA.php
signature.asc

T. Modes

unread,
Jan 6, 2025, 2:09:30 PMJan 6
to hugin and other free panoramic software
Abrimaal schrieb am Sonntag, 5. Januar 2025 um 03:09:40 UTC+1:
Wow, this is a huge step ahead.
This feature exits since 2010, so nothing new.
 
Unaligned image types
unsuccessful photos (sometimes happen)
select remove image from the context menu in the find pano dialog.
 
separators (any photo to separate panoramas taken one after one)
select split from the context menu in the find pano dialog

This should be done *before* running the assistant, otherwise the assistant will probably not run successful. Also cpfind does not work optimal with such wrong images in the pano.

Abrimaal

unread,
Mar 21, 2025, 8:30:08 PMMar 21
to hugin and other free panoramic software
Thank you for the hints,
although I haven't found out how to split (automatically) two panoramas in one .pto file.
Manually this is quite simple, to remove images that build the pano 1, save as a new .pto, then the same with the 2nd panorama.
Anyway, the images in the new .pto files must be reset: positons, lens and photometrics, then aligned again.

After stitching a few hundreds of simple and more complex panoramas in automatic mode,
I noticed:
Positive aspects:
- more free time
- better blending of objects, the long linear objects are not broken, the objects close to the camera are also well stitched. (I think the engine has been improved in the new version) - it refers to the manual mode too.
Negative aspects:
- a random image is selected as the anchor, it refers especially to exposures. (what about automatic selection of the highest exposure?)
- incorrect blending of the sky and ground - there are sharp lines when the exposures or colors between two images are significant. In the older versions of Hugin, there were smooth gradients, but the objects usually were broken.
- incorrect alignment of 2 image panoramas (see the attached photo). After resetting positions and lens, then optimizing again, the new panorama is ok.

Automatic stitching saves a lot of time, but many panoramas must be corrected manually. The weakest point is the vertical line detector.
Now the line detector assumes that every straight line is a vertical line.
The line detector will not work correctly without an object detector, using Ai to identify objects.
Does any freeware object detector exist, that could be included in Hugin?
To avoid placing "vertical" lines on signs, trees, human legs etc. and also to find vertical lines in incontinuous objects (for example windows on two floors, or joining bricks in a wall).
difference in align by assistant and by ui.jpg

Abrimaal

unread,
May 15, 2025, 9:40:49 PMMay 15
to hugin and other free panoramic software
In the Batch Processor, there is a button "User defined sequence"
I would like to modify the initial settings of batch panorama stitcher.

Part 1:
Where is the original sequence file located? 
That I could make a new file based on the original.
Now clicking the button does nothing.

I want the batch processor to
- Use Mercator projection for all panoramas
- Make two panoramas from each project: with exposure correction and without.

---------- ----------

Part 2:
I opened hugin.exe in a text editor,
replaced "Equirectangular" to "Mercator" (+ 7 spaces to keep the file length)

Started batch processor, but it still selects "Equirectangular" for panorama projection.
(I do not want any panoramas in the equirectangular projection, never ever)

After the replace, Hugin also starts with Equirectangular, but it should start in Mercator.
Where else should I replace the string "Equirectangular" to "Mercator" to make it work?
There are hundreds of files in Hugin folders. Please help me with this.

---------- ----------

Part 2.5 (by the way)
It resembles the situation when I wanted to replace _blended_fused and _fused to _bf and _f
I replaced all occurences in one file, but I still got panoramas with these long (too long) suffixes.
I found the strings _blended_fused and _fused in many other files.
Replacing one after one, finally it led to crash, but never saved any panorama with _bf or _f suffix.

Sometimes I also leave workfiles (_exposure_layers), shortening them to _ex

Now I use Bulk Rename Utility to shorten the suffixes.
I have to do it right after the panoramas are created (to avoid including these files into any other projects.)

---------- ---------- ---------- ----------

@ hvd...gmail.com
I will try Xpano, thanks for recommendation
z bulk rename shorten suffixes blended_fused exposure_layers etc.png
set initial projection.png
user defined sequence in batch.png
Message has been deleted

Abrimaal

unread,
May 16, 2025, 12:48:36 AMMay 16
to hugin and other free panoramic software
Update

found Mercator = set projection to 5 in normal.assistant  (file in share\hugin\data\assistant)

Now searching how to add custom commands in "When Done" menu of batch processor
The "any other" command could open any batch file, for example:  Delete all .log files, Open folder, Bulk Rename suffixes...
when done.png

Abrimaal

unread,
May 30, 2025, 11:52:24 PMMay 30
to hugin and other free panoramic software
I want to ask a few questions about the automatic assistant stitching:
1. Maximum time difference - is this the maximal interval between two partial photos in a panorama, or two panoramas?
2. How to set crop to "outside"? I tried --crop=Max, but it did not work (normal auto crop)
3. How to optimize exposures, but no colors?
By default the optimizer is set to Arguments=-a -m -l -s
What do the parameters mean?

T. Modes

unread,
Jun 1, 2025, 6:10:49 AMJun 1
to hugin and other free panoramic software
Hi,

Abrimaal schrieb am Samstag, 31. Mai 2025 um 05:52:24 UTC+2:
1. Maximum time difference - is this the maximal interval between two partial photos in a panorama, or two panoramas?
This is the maximal time difference between the corresponding input images of a single pano.
 
2. How to set crop to "outside"? I tried --crop=Max, but it did not work (normal auto crop)
By default the optimizer is set to Arguments=-a -m -l -s
What do the parameters mean?

See the help files. Or run the corresponding program with --help switch to print the help page of this program. (The latter may be more up to date.)

Abrimaal

unread,
Jun 1, 2025, 8:36:29 PMJun 1
to hugin and other free panoramic software

Pano_modify:

 Crop Outside - just removed crop="" from the assistant sequence, used center panorama "-c" parameter. Works.

Optimizer:

I could not find in help, how to optimize exposures, but not colors, the parameter "-m" optimizes both.

--- --- ---

New: "do not save log files" option.
The panoramas I make in the automatic process are somehow experimental, they often fail in progress.
Trying "quiet mode" for Optimizer "-q", but Logs are still saved.
Can I disable saving Logs at all (and for ever, until I change it)?

or can I add a step to assistant sequence, that deletes .log files,
such as

[Step6]
Description=Deleting Log files
Program=delLogs.cmd

.cmd file is located in Hugin/bin folder. Now my task is to get the current workfolder path.

---- ---- ----

New: comments in .assistant files
I want to type comments, what the parameters do (not to search again in help)

example of a comment:
; crop = AUTO, HDR or delete crop for MAX
::  crop = AUTO, HDR or delete crop for MAX
//  crop = AUTO, HDR or delete crop for MAX
REM crop = AUTO, HDR or delete crop for MAX

what prefix is correct for comment?
Reply all
Reply to author
Forward
0 new messages