Stitch images from command line

603 views
Skip to first unread message

Paul Premium

unread,
May 2, 2022, 10:19:30 AM5/2/22
to PTGui Support
Hi PTGui,

I have the pro version and I would like to know if it is possible to completely automatise the stitching process, without having to open PTGui. 

I have a device that scans and takes images in 360 degrees. It stores the scan images in the good order in a folder.
What I am asking is : Is it possible to execute PTGui batcher on this folder ONLY from command line ? So that nobody has to do anything, just execute an algorithm.

Thank you in advance for your answer,

Best Regards,

Paul.

Erik Krause

unread,
May 2, 2022, 10:22:23 AM5/2/22
to pt...@googlegroups.com
Am 02.05.22 um 16:19 schrieb Paul Premium:
> I would like to know if it is possible to
> completely automatise the stitching process, without having to open PTGui.

Should be possible. See https://ptgui.com/support.html#6_32

--
Erik Krause

Paul Premium

unread,
May 2, 2022, 10:31:44 AM5/2/22
to PTGui Support
These commands need .pts file, which I don't have since they are created from the software that I don't want to open..

Erik Krause

unread,
May 2, 2022, 10:53:44 AM5/2/22
to pt...@googlegroups.com
Am 02.05.22 um 16:31 schrieb Paul Premium:

> These commands need .pts file, which I don't have since they are created
> from the software that I don't want to open..

There are two ways around that: Either you rename the images to fit the
names in the project file or you modify the file, which is in JSON
format. In any case you should be familiar with templates:
https://ptgui.com/support.html#3_9

However, what exactly do you want to do?

--
Erik Krause

Mike Cowlishaw

unread,
May 2, 2022, 2:49:53 PM5/2/22
to pt...@googlegroups.com
This interesting .. Drone spherical panoramas typically put each collection of images into its own folder/directory (e.g., 26 or 34 for Mavic 2/Mavic Pro).  It would be really handy to be able to invoke PTGui from command line (actually from a REXX script, etc.) with the instruction to "stitch together all the images in this directory".   Is possible?

Mike


--
You received this message because you are subscribed to the Google Groups "PTGui Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ptgui+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ptgui/ff003075-48ab-6e7b-cace-6dbc758743fe%40gmx.de.

Erik Krause

unread,
May 2, 2022, 4:37:26 PM5/2/22
to pt...@googlegroups.com
Am 02.05.2022 um 20:49 schrieb Mike Cowlishaw:
> Drone spherical panoramas typically put each collection
> of images into its own folder/directory (e.g., 26 or 34 for Mavic 2/Mavic
> Pro). It would be really handy to be able to invoke PTGui from command
> line (actually from a REXX script, etc.) with the instruction to "stitch
> together all the images in this directory". Is possible?

Although it might be possible from the command line I'd use the Batch
Builder for this. In it's "Detect panoramas - One panorama per folder"
mode you point it to the parent folder of your panorama folders and it
should detect panoramas and create project files for all of them and
send them to the Batch Stitcher.

--
Erik Krause
http://www.erik-krause.de

Paul Premium

unread,
May 3, 2022, 4:27:32 AM5/3/22
to PTGui Support
Thank you very much. I'll check it out.

It is for a specific industrial purpose.
Paul Galtier

Mike Cowlishaw

unread,
May 3, 2022, 6:51:05 AM5/3/22
to pt...@googlegroups.com
OK, thanks!

--
You received this message because you are subscribed to the Google Groups "PTGui Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ptgui+un...@googlegroups.com.

Erik Krause

unread,
May 3, 2022, 6:56:59 AM5/3/22
to pt...@googlegroups.com
Am 03.05.22 um 10:27 schrieb Paul Premium:

> It is for a specific industrial purpose.

I bet there is a better solution than using the command line only, but
that's hard to say as long as we don't know what your goal is.

--
Erik Krause

Paul Premium

unread,
May 3, 2022, 9:24:51 AM5/3/22
to PTGui Support
Hi mike. I managed to find a solution to automatise the stitching using Python and command line.
It is possible to create a .pts file, and stitch this file with the Batch stitcher from command line. But how to stitch several folders ? With Python!

Using Python, you replace the images in the folder where the .pts file takes its input, and rename the images correctly. Then, you execute the command line from python (using the module subprocess), and copy the results to an external destination.

Feel free to ask if you have any question.

JCY

unread,
Aug 5, 2022, 9:57:55 AM8/5/22
to PTGui Support
Hi!

I have the exact same usage requirement, only that the images are captured via a handheld device and rotated 360 degrees. I used the same approach, using just one .pts file and changing file names. However the generated panorama often results in alignment and stitching errors between different image folders. How did you get past the alignment issue?

Thank You!

John Houghton

unread,
Aug 5, 2022, 12:59:52 PM8/5/22
to PTGui Support

On Friday, August 5, 2022 at 2:57:55 PM UTC+1 JCY wrote:
. . . the images are captured via a handheld device and rotated 360 degrees. I used the same approach, using just one .pts file and changing file names. However the generated panorama often results in alignment and stitching errors between different image folders.

Handheld camera shooting usually results in parallax issues, which inevitably lead to alignment problems and visible stitching glitches.  These are difficult to address automatically.  The find optimum seams blending option in PTGui Pro helps a lot in hiding these errors, but perfect stitching is often still not achieved.  A lot depends on the subject and how far away the parts of the scene are from the camera.  What exactly is the handheld device, and what sort of subjects are you photographing?  And what steps are you taking to minimize parallax issues?

John
Reply all
Reply to author
Forward
0 new messages