Batch stitching single images

18 views
Skip to first unread message

Abrimaal

unread,
Oct 14, 2025, 12:29:00 AM (3 days ago) Oct 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 AM (3 days ago) Oct 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 AM (3 days ago) Oct 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
Reply all
Reply to author
Forward
0 new messages