Command line + Python workflow in Windows for automatic process in PTGUI

767 views
Skip to first unread message

DeepApnea

unread,
Jun 28, 2021, 6:16:47 AM6/28/21
to PTGui Support
Hello PTGUI, 

I'm a new user of your software pro version (thanks you for this amazing tool), I do have some questions on how to implement PTGUI for automatic stitching 360 photos made by drone. Currently, I have a project with 100 folders and each folder contains 26 images which will create one single panorama (I have always the same naming convention for the images and number of images per folder). The photos were made using a DJI mini 2 in raw /JPEG. Questions:

1. is there any workflow with PTGUI that allows to stitch a set of photos using command line for multiple folders?
2. is it possible to create a batch processing for each set of images contained in folders using command line running on a python script?
3. is a good option to stitch images in raw or better to convert them to JPG?, I can see more details in raw. is it something that may affect the processing time computing ?

Best regards,
Jefferson Clyde
 

PTGui Support

unread,
Jun 28, 2021, 8:07:02 AM6/28/21
to pt...@googlegroups.com
Hi Jefferson,

Have you tried the batch builder? It might just do what you need. It can
scan a folder of folders, generate project files for each panorama and
send them to the batch stitcher. See Tools -> Batch Builder.

Otherwise, see 6.32 for the command line options:
https://www.ptgui.com/support.html#6_32

You will need to generate the project file manually. The project file is
in JSON format, so you might be able to do this using Python.

Loading raws in PTGui is slower, and PTGui doesn't do noise reduction or
CA correction like dedicated raw converters do. But otherwise, using raw
images is fine.

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com
> --
> 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
> <mailto:ptgui+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ptgui/44f6708e-3520-47d2-978c-1540b7db8661n%40googlegroups.com
> <https://groups.google.com/d/msgid/ptgui/44f6708e-3520-47d2-978c-1540b7db8661n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Erik Krause

unread,
Jun 28, 2021, 8:26:24 AM6/28/21
to pt...@googlegroups.com
Am 28.06.21 um 12:16 schrieb DeepApnea:

> 3. is a good option to stitch images in raw or better to convert them to
> JPG?

No. Better to convert to 16bit TIFF. This way (if done properly) the
complete dynamic range can be preserved. As Joost wrote you miss some of
the benefits of shooting raw if you use them directly in PTGui.

Also see https://www.ptgui.com/support.html#3_7

--
Erik Krause

DeepApnea

unread,
Jun 28, 2021, 10:23:17 AM6/28/21
to PTGui Support
Hello PTGUi, 

Have you tried the batch builder? It might just do what you need. It can
scan a folder of folders, generate project files for each panorama and
send them to the batch stitcher. See Tools -> Batch Builder.

Otherwise, see 6.32 for the command line options:
https://www.ptgui.com/support.html#6_32

You will need to generate the project file manually. The project file is
in JSON format, so you might be able to do this using Python.
-------------------------------------------------------

Thanks you so much for replying my message. You said I can create one project file (.pts) and change the file configuration for each folder using python? , then call the batch stitcher to create the 360 image?. My idea is to avoid manual process within the workflow. I have seen that for each file name in a pts some metadata is presented, so it is necessary to use a tool such as exiftool to extract the metadata present in the images. What about control points and  data created by PTGUI?.  One more thing, I am not able to the the directory of my images within my project file (pts)

DeepApnea

unread,
Jun 28, 2021, 10:33:39 AM6/28/21
to PTGui Support

Hello Erik,

Thanks you for replying my message. Do you know any good software and a logic workflow for this task?...I have seen some software such as dcraw that allows to manage raw data.

Best regards
Jefferson

Erik Krause

unread,
Jun 28, 2021, 10:56:12 AM6/28/21
to pt...@googlegroups.com
Am 28.06.21 um 16:33 schrieb DeepApnea:
> Thanks you for replying my message. Do you know any good software and a
> logic workflow for this task?...I have seen some software such as dcraw
> that allows to manage raw data.

dcraw wouldn't be any better than PTGui. In fact PTGui used it for a
long time until it wasn't maintained any more. libraw is built on top of
dcraw.

Decent raw converters are lightroom or Adobe Camera Raw (which are
essentially the same), DxO and some others, or on the open source side
f.e. rawtherapee. AFAIK all of them support batch processing and
applying the same parameters to more than one file, which is essential
for panorama stitching.

The benefit of using a decent raw converter instead of dcraw or libraw
are many. It's not only automatic correction of chromatic aberration and
denoising, but also highlight reconstruction and de-bayering algorithms
that avoid moiree or automated removal of hot or dead pixels f.e.

If you don't need all that it might be easier to shoot jpg instead,
since many cameras do sophisticated corrections themselves.

--
Erik Krause

DeepApnea

unread,
Jun 28, 2021, 11:18:08 AM6/28/21
to PTGui Support

Erik,

Thank you so much, now everything is clear for me. I will try to shoot jpg with my drone.

Jefferson Clyde 



PTGui Support

unread,
Jun 28, 2021, 11:46:52 AM6/28/21
to pt...@googlegroups.com
Yes, basically it's a matter of taking an existing project and modifying
the file names in the project file. Or reuse the project file as-is, and
rename your image files so they match the project file.

Take a look at Project Settings -> Batch Stitcher Actions:
If 'Do Align Images' is checked, the batch stitcher will analyze the
images and generate control points.
If it's unchecked, the batch stitcher will stitch the project exactly as
in the template. With a drone, the former is probably what you need, so
make sure to check this box.

Once you have a project file, metadata is not important for stitching.
This is only needed to initialize the lens parameters.

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com

> www.ptgui.com <http://www.ptgui.com>
> <https://groups.google.com/d/msgid/ptgui/44f6708e-3520-47d2-978c-1540b7db8661n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ptgui/44f6708e-3520-47d2-978c-1540b7db8661n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> 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
> <mailto:ptgui+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ptgui/239f1eb2-3719-446a-a1bb-3f5f2b3ab868n%40googlegroups.com
> <https://groups.google.com/d/msgid/ptgui/239f1eb2-3719-446a-a1bb-3f5f2b3ab868n%40googlegroups.com?utm_medium=email&utm_source=footer>.

DeepApnea

unread,
Jun 28, 2021, 2:49:44 PM6/28/21
to PTGui Support
Joost, 

Thank you for helping me to understand better how PTgui works. One question, I did see that each project file (pts) is associated to one directory,  but I did not see the directory path within the pts file (is it hide by the software?). So, should I need to copy the images within the directory each time to call the Batch stitcher process?.

Best regards, 
Jefferson Clyde

PTGui Support

unread,
Jun 29, 2021, 3:51:17 AM6/29/21
to pt...@googlegroups.com
By default, relative path names are used. The file names are relative to
the project file.

So if you have:

C:\Panoramas\project.pts
and
C:\Panoramas\images\image1.tif

then the image is stored as
images\image1.tif

Keep in mind that in JSON a backslash must be escaped to a double backslash.

Kind regards,

Joost Nieuwenhuijse
www.ptgui.com

> www.ptgui.com <http://www.ptgui.com>
> > www.ptgui.com <http://www.ptgui.com> <http://www.ptgui.com
> <https://groups.google.com/d/msgid/ptgui/239f1eb2-3719-446a-a1bb-3f5f2b3ab868n%40googlegroups.com?utm_medium=email&utm_source=footer
> <https://groups.google.com/d/msgid/ptgui/239f1eb2-3719-446a-a1bb-3f5f2b3ab868n%40googlegroups.com?utm_medium=email&utm_source=footer>>.
>
>
> --
> 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
> <mailto:ptgui+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ptgui/88d462ea-6833-4516-9a3d-9d46da1ace24n%40googlegroups.com
> <https://groups.google.com/d/msgid/ptgui/88d462ea-6833-4516-9a3d-9d46da1ace24n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages