Batch stitching single images

40 views
Skip to first unread message

Abrimaal

unread,
Oct 14, 2025, 12:29:00 AMOct 14
to hugin and other free panoramic software
I am looking for a way to straighten single images, using batch process (for example 1000 video frames in a folder).

How can I write a script?
- command line / pto file / assistant script

Can anyone recommend?

Abrimaal

unread,
Oct 14, 2025, 12:31:31 AMOct 14
to hugin and other free panoramic software
* straightening, not stitching, sorry
I mean: open image 1, projection=rectilinear, find vertical lines, autocrop (max or optimal), save image to a different folder.
Repeat to the last image.

Greg 'groggy' Lehey

unread,
Oct 14, 2025, 12:44:35 AMOct 14
to hugi...@googlegroups.com
On Monday, 13 October 2025 at 21:29:00 -0700, Abrimaal wrote:
> I am looking for a way to straighten single images, using batch process
> (for example 1000 video frames in a folder).
>
> How can I write a script?
> - command line / pto file / assistant script

I'm not sure I understand this last line, but it sounds like something
I do regularly, though with far fewer than 1000 images.

My scripts are barely too long to quote here, so you'll have to follow
the links.

1. mkpto makes .pto files from specific files (those matching C/*EV*;
hysterical raisins). You would need to change that, or eliminate
this step altogether and go to the next step.

2. mpkto1 does the real work, invoking a number of standard Hugin
programs and also a script discolour.

3. discolour removes colour skew from the .pto files.

At this point I run the Hugin GUI to check and maybe frob the .pto
files.

4. stitch does the actual stitching.

They will almost certainly need changing for your purposes. You can
find all four scripts at

http://www.lemis.com/grog/src/mpkto
http://www.lemis.com/grog/src/mpkto1
http://www.lemis.com/grog/src/discolour and
http://www.lemis.com/grog/src/stitch

Let me know if you need any explanations.

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

Abrimaal

unread,
Oct 24, 2025, 7:56:36 PMOct 24
to hugin and other free panoramic software
Well, I need explanations in almost every step, because I am not a programmer.
I downloaded discolour and stitch files (the links to mpkto were dead, but after correcting to mkpto, I downloaded them too).
Now there are 4 text files. What file extensions should I give them to be correct?
Do they work with hugin (as scripts, readable by Hugin) or
Do they contain source code that needs to be compiled to make executable files?
Reply all
Reply to author
Forward
0 new messages