Default Settings

200 views
Skip to first unread message

Michael Perry

unread,
Nov 18, 2018, 4:46:51 AM11/18/18
to hugin and other free panoramic software
I use Hugin to stitch mosaics. I find the best procedure is to optimise for X and Y before y, p and r. I have to select Custom parameters to be able to do this, then after de-selecting yaw, pitch and roll in the Optimiser tab, I select the X and Y variables columns in their place. 

Is there a way to change the default settings for Hugin so that, on opening the application:
a) Custom parameters is always selected in Photos tab and X and Y columns are selected in the Custom tab?
b) Similarly, is there a way to change the default projection from Equirectangular to Rectilinear?

Thank you for your thoughts

Michael Perry

unread,
Aug 22, 2020, 10:31:54 AM8/22/20
to hugin and other free panoramic software
Can anyone advise me how to change the default settings for y, p, r, X, Y, projection (to and move/drag (to mosaic)
Also, is there some way that I can restrict the clustering of control points - reducing the number of points created in similar locations - I'd rather have 5 well-spaced control points per overlap than 25 control points

thank you

Michael Perry

unread,
Feb 25, 2021, 8:00:58 AM2/25/21
to hugin and other free panoramic software
I wonder if there is anyone in the forum who has a view about this?

Michael Perry

unread,
Apr 14, 2022, 5:57:59 AM4/14/22
to hugin and other free panoramic software
Is there a way to get the Hugin 2019.2.0 to use Rectilinear Projection as its default projection rather than Equirectangular?

Bruno Postle

unread,
Apr 14, 2022, 9:39:21 AM4/14/22
to hugin and other free panoramic software
I'm not at a computer, so I can't point directly to functionality, but I seem to remember that the default Hugin Assistant has an angle of view threshold, below which it chooses rectilinear, and above which it chooses equirectangular.

Regarding custom workflows that don't use these default Assistant settings (again, I can't point to this off the top of my head), there are a series of Hugin 'executor' configurations that you can use instead. These are in an easy-to-edit INI format, so you are encouraged to modify, create and share. I haven't played with them since they were first introduced, it would be really useful if you could try this method and describe your success or failure here, as they are an underused resource that more people would use if they were aware.

--
Bruno

Michael Perry

unread,
Apr 15, 2022, 7:54:31 AM4/15/22
to hugin and other free panoramic software
Bruno, thank you - However, I suspect that the Python Plugin Interface (which I believe is what I would need to do that) does not work with the OSX version of Hugin. I can not find it in my Preferences menus nor an angle of view threshold. I think instead that I will create a library of .pto files (1 x 2 frames , 2 x 2 frames, 2 x 3 frames, 3 x 3 frames and so on) where I would just need to substitute the filenames of my images, preset an XY optimisation, and then find control points, and then optimise pitch, yaw and Z.
--
Michael

Bruno Postle

unread,
Apr 15, 2022, 1:05:13 PM4/15/22
to hugin and other free panoramic software
Generating templates like this is a good approach, and it works well in the GUI and on the command-line.

Though I wasn't referring to the python API, the 'Executor' system is used by Hugin when aligning and stitching using the Assistant. It is configurable by editing these INI files.

-- 
Bruno

On Fri, 15 Apr 2022, 13:54 'Michael Perry' via hugin and other free panoramic software, wrote:
Bruno, thank you - However, I suspect that the Python Plugin Interface (which I believe is what I would need to do that) does not work with the OSX version of Hugin. I can not find it in my Preferences menus nor an angle of view threshold. I think instead that I will create a library of .pto files (1 x 2 frames , 2 x 2 frames, 2 x 3 frames, 3 x 3 frames and so on) where I would just need to substitute the filenames of my images, preset an XY optimisation, and then find control points, and then optimise pitch, yaw and Z.


On Thursday, 14 April 2022 at 14:39:21 UTC+1 bruno...@gmail.com wrote:
I'm not at a computer, so I can't point directly to functionality, but I seem to remember that the default Hugin Assistant has an angle of view threshold, below which it chooses rectilinear, and above which it chooses equirectangular.

Regarding custom workflows that don't use these default Assistant settings (again, I can't point to this off the top of my head), there are a series of Hugin 'executor' configurations that you can use instead. These are in an easy-to-edit INI format, so you are encouraged to modify, create and share. I haven't played with them since they were first introduced, it would be really useful if you could try this method and describe your success or failure here, as they are an underused resource that more people would use if they were aware.

Michael Perry

unread,
Apr 26, 2022, 10:34:22 AM4/26/22
to hugin and other free panoramic software
Oh! How exciting. I had not come across this Executor system - I will search for it. Thank you

Michael Perry

unread,
Apr 27, 2022, 2:30:50 PM4/27/22
to hugin and other free panoramic software

Dear Bruno

I am converting my workflow to the command line. I have a problem with pto_var and a question about pano_modify, I wonder if you can advise me.


BACKGROUND

I am stitching a mosaic of images of a painting. The photographs have been shot with a camera mounted on a gimbal that is itself suspended on an X-Y frame. The biggest difference between one image and the next is its X-Y position. In theory they should all have the same pitch and yaw as the camera moves little on its gimbal. There is some slight Z to account for as the frame is not perfectly parallel to the painting. The images have to be rotated some 90 degrees.

The images have been pre-processed for lens distortion and vignetting with Capture One, so I am ignoring lens parameters.


COMMAND LINE

I have been using the following commands to build the .pto file. I have annotated them in case it is useful for other people


pto_gen -p 0 -f 40.7 -o project.pto *.tif

(create the project with all files in folder, rectilinear projection and a 50mm lens (FOV = 40.7)


cpfind --multirow --fullscale -o project_cp.pto project.pto

(find control points in a mosaic, full-scale probably not necessary for me)

 

cpclean -o project_clean.pto project_cp.pto

(clean control points)


pto_var --set=r=90 --opt=TrX,TrY -o project_XY.pto project_clean.pto

(set X-Y variables of all images EXCEPT anchor, for optimisation)


autooptimiser -n -o project_XY.pto project_XY.pto

(optimise images for X and Y)


pto_var --opt=y,p,TrZ -o project_ypZ.pto project_XY.pto

(set pitch, yaw and Z of all images EXCEPT anchor)

This is where I have the problem, I need to select the yaw and pitch of the anchor image for optimisation with all the rest. I can not see how to do that easily.



POSSIBLE SOLUTION

pto_var --opt=y0,p0,y1,p1,TrZ -o project_ypXYZ.pto project_ypZ.pto

(set pitch, yaw and Z of all images INCLUDING anchor)

It is possible to select the anchor if each image is individually selected. HOWEVER when large mosaics are stitched it makes for clumsy code.



EXTRA QUESTION

pano_modify --projection=0 --fov=AUTO -o finished.pto project_ypXYZ.pto

(Set projection to Rectilinear, fit image to screen)

I finalise the image in Fast Panorama preview having set Projection to Rectilinear and fitted the image to the screen. It would be helpful if I could also set the Drag Mode to Mosaic in the Move/Drag tab and the Overview Mode to Mosaic Plane. Is there some code that might effect this?


Hoping you will find these interesting problems.


Michael



Bruno Postle

unread,
Apr 27, 2022, 6:12:41 PM4/27/22
to hugin and other free panoramic software
Hi Michael, it has been quite a while since I have done anything this
complex in pto_var ot pano_modify, so I hope somebody else can answer
your detailed questions.

A couple of things I noticed:

You are running cpclean immediately after running cpfind, but cpclean
filters control points based on how well they optimise, so you should
run it after optimisation, or at least after you have set all your
optimisation parameters. Then usually you would run optimisation again
after running cpclean.

Although fixing barrel distortion in an external tool should be fine,
you might want to let Hugin optimise vignetting if you are also
optimising exposure, Hugin uses the exposure distribution caused by
the vignetting to calculate the camera response curve.

I don't think Hugin settings like mosaic drag mode are stored in the
PTO file, in which case it wouldn't be possible to set this on the
command-line.

--
Bruno
--
Bruno

Michael Perry

unread,
Apr 28, 2022, 5:39:12 AM4/28/22
to hugin and other free panoramic software
Bruno, thank you for replying and so quickly.

cpclean - I shall move this, optimise and re-optimise as you suggest.

vignetting - I believe I do not need to optimise exposure as I am shooting in controlled lighting (it does not change). In practice I use a raking light; so I don't want anything to happen to exposure until I get to Photoshop where I can apply a neutral gradient to correct it.

mosaic drag - yes, it resets on opening Hugin, it's not stored in the .pto nor, sadly, in the plist. I suppose it is hard-wired in the programme somehow.

I wonder if future incarnations of Hugin could include preferences for the Optimiser (orientation parameters) and Fast Panorama Preview (mosaic drag and projections)

Michael Perry

unread,
Apr 28, 2022, 6:23:49 AM4/28/22
to hugin and other free panoramic software
pto_var: can anyone tell me whether there is a way to specify, for example, optimising yaw of all images including the anchor without having to specify each image?

Thus, some sort of:
--opt=yALL
rather than
 --opt=y0,y1,y2,y3,y4…

T. Modes

unread,
Apr 28, 2022, 11:30:21 AM4/28/22
to hugin and other free panoramic software
michae...@mac.com schrieb am Donnerstag, 28. April 2022 um 12:23:49 UTC+2:
pto_var: can anyone tell me whether there is a way to specify, for example, optimising yaw of all images including the anchor without having to specify each image?

Thus, some sort of:
--opt=yALL
rather than
 --opt=y0,y1,y2,y3,y4…

Assuming anchor is first image (image index 0):
pto_var --opt=y,y0

Michael Perry

unread,
Apr 29, 2022, 8:05:52 AM4/29/22
to hugin and other free panoramic software
Thank you, that works simply and perfectly

Michael Perry

unread,
May 9, 2022, 1:58:09 PM5/9/22
to hugin and other free panoramic software
Should anyone be interested, this is a script developed for stitching (mosaic) images in a folder prior to tidying up rotation, fine-tuning CPs, adjusting FoV and stitching in Hugin. 

#!/bin/bash
pto_gen -p 0 -f 40.7 -c 200,5560,133,3707 -o project.pto *.tif
cpfind --multirow --fullscale --sieve1width 12 --sieve1height 8 --sieve2width 4 --sieve2height 4 --sieve2size 1 -o project_cp.pto project.pto
pto_var --set=r=90 --opt=TrX,TrY -o project_XY.pto project_cp.pto

autooptimiser -n -o project_XY.pto project_XY.pto
pto_var --opt=y,y0,p,p0,TrZ -o project_ypZ.pto project_XY.pto
autooptimiser -n -o project_ypZ.pto project_ypZ.pto
pto_var --opt=y,y0,p,p0,TrX,TrY,TrZ -o project_ypXYZ.pto project_ypZ.pto
autooptimiser -n -o project_ypXYZ.pto project_ypXYZ.pto
cpclean --fast -o project_clean.pto project_cp.pto
pto_var --opt=y,y0,p,p0,TrX,TrY,TrZ -o project_ypXYZ.pto project_ypXYZ.pto
autooptimiser -n -o project_ypXYZ.pto project_ypXYZ.pto

pano_modify --projection=0 --fov=AUTO -o finished.pto project_ypXYZ.pto

Reply all
Reply to author
Forward
0 new messages