Hugin defaults to equirectangular projection. Pto_gen --projection=0 not working

37 views
Skip to first unread message

Claudio Rocha

unread,
Sep 4, 2022, 12:30:24 PMSep 4
to hugin and other free panoramic software
pto_gen does not set the projection specified.

For example: if I do

pto_gen --projection=0 project.pto *.tif

I would expect the projection to be rectilinear (p f0 on the .pto file).
But when I open the project in hugin the stitch projection is set to equirectangular (p f2 on the .pto file).

Only if I manually edit the project to be rectilinear and save, the file will be set with the correct projection.

I tried --projection=0 and -p 0  but I get the same results, and also tried other projections and the -p flag seems to be ignored completely, and the resulting project is always set to equirectangular

The same thing happens when I merge projects using pto_merge. to merge several projects (all set to rectilinear projection). The resulting merged file will be set to equirectangular.

I've been manually changing the project's projection using sed for scripts, but I believe this could be avoided.

Is the equirectangular projection set as default somewhere that I can edit and return to the expected rectilinear projection?

I'm using hugin on Linux Mint

Operating System: Linux 5.4.0-113-generic x86_64
Architecture: 64 bit
Free memory: 23720368 kiB

Hugin
Version: 2021.0.0.52df0f76c700
Path to resources: /usr/share/hugin/xrc/
Path to data: /usr/share/hugin/data/
Multi-threading using C++11 std::thread and OpenMP
Monitor profile: 24M45 #2 2022-06-03 17-49 120cdm2 2.2 F-S XYZLUT+MTX

Libraries
wxWidgets: wxWidgets 3.0.4
wxWidgets Library (wxGTK port)
Version 3.0.4 (Unicode: wchar_t, debug level: 1),
Runtime version of toolkit used is 3.24.
Compile-time GTK+ version is 3.24.14.

libpano13: 2.9.19
Boost: 1.71.0
Exiv2: 0.27.2
SQLite3: 3.31.1
Vigra: 1.11.1
LittleCMS2: 2.9

T. Modes

unread,
Sep 4, 2022, 1:06:34 PMSep 4
to hugin and other free panoramic software
marmi...@gmail.com schrieb am Sonntag, 4. September 2022 um 18:30:24 UTC+2:
pto_gen does not set the projection specified.

For example: if I do

pto_gen --projection=0 project.pto *.tif

I would expect the projection to be rectilinear (p f0 on the .pto file).
But when I open the project in hugin the stitch projection is set to equirectangular (p f2 on the .pto file).

Pto_gen sets the projection (aka lens type) of the individual images:
From the pto_gen help page:
-p | --projection number Sets the projection type for all images

To change the panorama projection use pano_modify --projection=..


Claudio Rocha

unread,
Sep 4, 2022, 1:35:38 PMSep 4
to hugin and other free panoramic software

Pto_gen sets the projection (aka lens type) of the individual images

Thanks for the response, but still makes no sense.
All of the images are read as rectilinear (f0) but the project is generated as equirectangular no matter what.

Claudio Rocha

unread,
Sep 4, 2022, 1:46:57 PMSep 4
to hugin and other free panoramic software
Pano_modify works fine, thanks.

But it would be best if the project was created correctly from the start... Otherwise what is the point of having the --projection=* option in pto_gen?


On Sunday, September 4, 2022 at 10:06:34 AM UTC-7 T. Modes wrote:

T. Modes

unread,
Sep 4, 2022, 1:59:23 PMSep 4
to hugin and other free panoramic software
marmi...@gmail.com schrieb am Sonntag, 4. September 2022 um 19:35:38 UTC+2:

Pto_gen sets the projection (aka lens type) of the individual images
But it would be best if the project was created correctly from the start... Otherwise what is the point of having the --projection=* option in pto_gen?
Thanks for the response, but still makes no sense.
All of the images are read as rectilinear (f0) but the project is generated as equirectangular no matter what.
 
You are mixing things. There are 2 different projections used in the workflow.
* Each input image has an projection which describes the lens type of the used lens - this is set with pto_gen --projection=
* The remapped panorama has its own projection. This is independent of the projection/lens type of the input images and describes the remapping of the final pano. This is set by pano_modify --projection=..

Okay, during writing my answer you added more questions.

> But it would be best if the project was created correctly from the start...
Define "correct"! There are several different use cases and each one needs a different output projection. So there is no single correct one. E.g. take the use case of a simple panorama by rotating the camera. In this case  equirectangular is probably the best choice of start. But as I already wrote this can be easily changed with pano_modify.

>Otherwise what is the point of having the --projection=* option in pto_gen?
Not everybody is using a rectilinear lens. Some are using fisheye lenses or want to remap equirectangular images. This information needs to be added to the project file and therefore this pto_gen option is needed. Only when *you* don't need this option, it is not superfluous.

Message has been deleted

Claudio Rocha

unread,
Sep 4, 2022, 3:25:27 PMSep 4
to hugin and other free panoramic software
thanks for the answers
Reply all
Reply to author
Forward
0 new messages