Scale panorama FOV

156 views
Skip to first unread message

ChameleonScales

unread,
Mar 10, 2020, 7:00:10 AM3/10/20
to Hugin Google Group
I have a panorama that is sewed correctly except the entire panorama covers a field of view that I know is too small.

How would I go about scaling the entire thing up or down, that is, change the field of view of the whole panorama, effectively changing all the y,p,r and distortion parameters of each photo so that the panorama looks the same except bigger on the sphere ?

ChameleonScales

unread,
Mar 28, 2020, 2:10:12 PM3/28/20
to Hugin Google Group
Allow me to clarify.

This is an animation of the effect I want to achieve (made in Blender):

resize_pano.gif

The reason I need to do this is that if the HFOV is too small, then the reprojection (in my case cylindrical) will not be correct.


Bruno Postle

unread,
Mar 28, 2020, 4:46:10 PM3/28/20
to hugi...@googlegroups.com


On 28 March 2020 18:10:00 GMT, 'ChameleonScales' wrote:
>Allow me to clarify.
>
>This is an animation of the effect I want to achieve (made in Blender):
>
>[resize_pano.gif]
>
>The reason I need to do this is that if the HFOV is too small, then the
>reprojection (in my case cylindrical) will not be correct.

To get this effect you need to increase the angle of view of the input photos, but there is no easy way to calculate the change in spacing needed to keep them aligned. So you will need to reoptimise positions at least, and probably barrel distortion too.

Note that I haven't often seen this problem, a wide panorama with lots of control points usually gets a good angle of view during optimisation, even when it isn't a full 360°.

--
Bruno

ChameleonScales

unread,
Mar 29, 2020, 8:01:39 PM3/29/20
to hugi...@googlegroups.com
Thanks, that's what I ended up doing but it was comparatively very cumbersome for an effect I could achieve with a single slider in Blender.
Also, this situation is not so rare in my case. I get photos from clients who don't have much or any experience in panoramic photography and these miscalculations happen quite often as a result.
So, unless there's a more appropriate place than here for feature requests, consider this mine :

Hugin Scale mockup.jpg

The apply button would change y,p,r and distortions values on all photos to preserve the aspect of the entire panorama just like in the animated gif above.
Each of the 3 scaling modes would have its own apply button and the tooltip could be the same for all 3 of them.
Does that seem feasible and the right way to approach this to you ?

Bruno Postle

unread,
Mar 30, 2020, 2:43:52 AM3/30/20
to hugi...@googlegroups.com


On 30 March 2020 01:01:29 BST, 'ChameleonScales' wrote:
>
>The apply button would change y,p,r and distortions values on all
>photos to preserve the aspect of the entire panorama just like in the
>animated gif above.
>Each of the 3 scaling modes would have its own apply button and the
>tooltip could be the same for all 3 of them.
>Does that seem feasible and the right way to approach this to you ?

The problem is that, although you could estimate all the new photo positions after scaling their angle of view, you still need to rerun the optimiser to get a good alignment. If you are rerunning the optimiser anyway, why estimate the new positions first?

This is all trying to fix a problem that shouldn't exist in the first place, Hugin should just get the angle of view calculation right - and if it isn't, then this is what should be fixed.

--
Bruno

ChameleonScales

unread,
Mar 30, 2020, 3:37:42 AM3/30/20
to hugi...@googlegroups.com
Unless I'm missing some geometrical effect, it doesn't seem to me that you would have to re-optimize it given that the transformation should precisely preserve the panorama's sewing just like in the animation above, so as I understand it, control point distances should only change proportionally to the scale you apply. But correct me if I'm wrong.

As for getting it right in the first place, in my use case, I have to superimpose a panorama to its virtual 3D environment in Blender and I need sub-degree precision on the HFOV.
I don't think any software could make such a precise guess with the photos I get from my clients.

Klaus Foehl

unread,
Mar 30, 2020, 4:35:23 AM3/30/20
to hugi...@googlegroups.com
As you are talking sub-degree precision, there is an inherent limitation
in the hugin lens model or abc parametrisation. From the Brown-Conradi
model, a mathematically sound distortion description, hugin implements
only one of the non-trivial parameters, which is parameter b.

Parameters a and c are not in Brown-Conrady, for polar coordinates they
are mathematically not sound, and in practice their use does not lead to
the quantitative alignment improvement an extra good parameter would
provide.

To add to it, I have seen situations where the use of a and c parameters
have made things observably bad. If parameters b and the offset
parameters d and e provide you with enough precision, then fine, then
hugin is a really good tool for you.

On 30.03.20 09:37, 'ChameleonScales' via hugin and other free panoramic

ChameleonScales

unread,
Mar 30, 2020, 9:37:10 AM3/30/20
to hugi...@googlegroups.com
Ok. It's fine if it doesn't get that precise. I can work with around 1 degree if the software doesn't allow for less.

The point is that having a scaling feature would allow me to fine-tune the scale based on what I know.

Since I superimpose my panorama to imported terrain and map data in Blender, I can see when a building or hill should be slightly more to the left or right on the photo, then adjust the FOV in Blender using the slider I made, and I know this FOV to be correct. I just don't know an easy enough way to give this back to Hugin so it exports a corrected version.


‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
> --
>
> A list of frequently asked questions is available at: http://wiki.panotools.org/Hugin_FAQ
>
> ------------------------------------------------------------------------------------------
>
> You received this message because you are subscribed to the Google Groups "hugin and other free panoramic software" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hugin-ptx+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/hugin-ptx/282135e3-7846-f179-5382-410c95b68c4e%40gmail.com.


T. Modes

unread,
Mar 30, 2020, 11:16:47 AM3/30/20
to hugin and other free panoramic software
 
Am Montag, 30. März 2020 09:37:42 UTC+2 schrieb ChameleonScales:
Unless I'm missing some geometrical effect, it doesn't seem to me that you would have to re-optimize it given that the transformation should precisely preserve the panorama's sewing just like in the animation above, so as I understand it, control point distances should only change proportionally to the scale you apply. But correct me if I'm wrong.

You can't change the HFOV of the input image and expect that the output scales linear only.
See attached image for an example: on the left side is HFOV of the input image 20 deg, on the right side 100 deg. Both are re-projected to the equirectangular projection. Then you will see that there are more changes than a "simple" scale factor in the output.
hfov_scale.jpg

ChameleonScales

unread,
Mar 30, 2020, 3:24:45 PM3/30/20
to hugi...@googlegroups.com
Sorry, maybe my phrasing was misleading. I didn't mean the panorama should scale linearly on the reprojection.

What I meant is that, yes, each photo has to be distorted, but in such a way that the overlapping pixels between 2 photos don't drift apart, resulting in the same effect as my animated gif from before shows.

However, I'm just realizing that it requires a kind of distortion that may not be implemented in Hugin. I would have to work out the math from my Blender file.
Need some time to do this.

ChameleonScales

unread,
Mar 31, 2020, 4:15:40 AM3/31/20
to hugi...@googlegroups.com
Nevertheless, if this required a new kind of distortion, do you think it could be considered for a new feature ?

Bruno Postle

unread,
Mar 31, 2020, 4:32:16 AM3/31/20
to hugi...@googlegroups.com


On 31 March 2020 09:15:33 BST, 'ChameleonScales' wrote:
>Nevertheless, if this required a new kind of distortion, do you think
>it could be considered for a new feature ?

Have you tried optimising the angle of view of the input photos? This is something that Hugin does really well, it is very unlikely to conclude that a 180° panorama is actually 90°, mainly because it is very difficult to fit a 180° panorama into the very different curvature of a 90° space and vice-versa - this is why just scaling positions and angle of view of the input photos isn't enough to scale the final panorama.

--
Bruno

ChameleonScales

unread,
Mar 31, 2020, 9:24:07 AM3/31/20
to hugi...@googlegroups.com
Again, that's what I ended up doing (cf my 3rd post)

But in fact it's not even the best existing solution for me. Right now the quickest and easiest solution is to re-render the corrected panorama from Blender.

However, it adds a pipe in my pipeline. Which means if I realize I have to modify the .pto file, I will have to feed it through Blender again.
A scale feature in Hugin would make the process more dynamic.

But anyway, I need some time to look up how this distortion would be done in Hugin, because it might be impossible to use the existing distortion parameters, so it would have to be a new kind that would sit on top of all the others, which would understandably require a much higher demand that my request alone, so I hope my math intuition is wrong.

Abrimaal

unread,
Apr 1, 2020, 7:03:03 PM4/1/20
to hugin and other free panoramic software
Maybe it will be useful to do it in two steps.
Load the final panorama to Hugin (as a single image) and change the field of view.
This is a 360° panorama with HFOV changed to 20° I think it will work in both ways.
360 deg pano changed to 20 deg.jpg

Klaus Foehl

unread,
Apr 2, 2020, 6:20:48 AM4/2/20
to hugi...@googlegroups.com
You need not be so pessimistic. Typical alignment deviations are in the
3 to 5 pixels ballpark at the edge, and can go up to 15 pixels in the
corner for a particular "bad" lens (meaning the hugin abc model cannot
cope with that lens), all using the barrel distortion parameter b. Now
do the maths for an image 4000 pixels wide with 40 degrees field of
view. 10 pixels still give you 1/10 degrees.

Another issue are EXIF-provided lens parameters. If hugin takes them as
gospel (view not optimised) in the way it does, one may be wrong in
focal length by a few percent. The way to calibrate this is to take a
360-degrees panoramic and let hugin determine the parameter v, and
possibly the full set of parameters for your individual camera lens.

On 30.03.20 15:37, 'ChameleonScales' via hugin and other free panoramic

David W. Jones

unread,
Apr 2, 2020, 5:09:26 PM4/2/20
to hugi...@googlegroups.com
In general, it probably is best to calibrate your specific lens in Hugin, particularly if it's one you use a lot for panorama work.

Of course, getting your clients to do that may be another matter entirely.
--
David W. Jones
gnome...@gmail.com
wandering the landscape of god
http://dancingtreefrog.com

Sent from my Android device with F/LOSS K-9 Mail.
Reply all
Reply to author
Forward
0 new messages