Page 1 of 2

### Focal length changes between photo and panorama

Posted: Tue Oct 12, 2010 3:03 pm
I am a little confused by the change in focal length associated with the photographs â€˜pre-stitchingâ€™ and when â€˜stitched as a panorama, ready to be renderedâ€™. The â€˜35mm focal length equivalentâ€™ of the photos is slightly higher when it is part of the panorama (ready to be rendered). I need to know the 35mm equivalent focal length of the panorama (accurately) to be able to calculate the â€˜viewing distanceâ€™ of the print (i.e. the distance the person viewing the printed panorama needs to hold the printed version from their eye) such that it replicates the scale of the view as seen by the naked eye from where the photograph was taken. Should I be using the focal length of the original photograph or the focal length shown in the panorama to calculate this distance?

Karl

Posted: Fri Oct 15, 2010 2:12 pm
Unfortunately no responses yet, so maybe my question can be rephrased...

Can anyone explain why the focal lengths shown on the original photographs (in Autopano) are different when shown as a panorama? Is it a way of quantifying how much distortion has been applied by Autpano to allow accurate 'stitching' of the photos?

It may help me find a solution to my problem if I can understand why the focal lengths change.

Many thanks

Karl

Posted: Fri Oct 15, 2010 2:32 pm
Maybe I don't understand the question, but are you sure you're not mixing up focal length and FOV (field of view)?

Posted: Fri Oct 15, 2010 2:43 pm
No - definitely Focal length.

For example i have some photos taken that (individually) have a (35mm format equivalent) focal length of 52mm in the EXIF data (and 52mm again in the properties section in the groups view of the main interface). When I go through to the panorama editor, the focal length in the layer area shows a (35mm format equiv.) focal length of 56.26mm.

I don't understand why these focal lengths are different.

Hope you can help.

Many thanks

Karl

Posted: Fri Oct 15, 2010 5:23 pm
I cannot give the mathematical explanation, but in simpler terms, I think that's because the images get remapped (warped) on a sphere, which is calculated according to the control points found (and is not fixed according to the FL found in the EXIF, which is used just as a starting point).

Posted: Fri Oct 15, 2010 6:28 pm
'[bo wrote:']I think that's because the images get remapped (warped) on a sphere

An easy to grasp example is a 360 degrees pano were focal length is adjusted so that the whole pano will correspond to 360 degrees. In other situations Autopano adjustment is useful to ensure that straight lines in the subject are straight in the resulting image.

As a rule, EXIF data about focal length are approximative (for example zooming steps are rather large, on some lenses focusing changes focal length, etc.)

Posted: Mon Oct 18, 2010 9:43 am
Ok - thank you... so, taking this a step further to my practical application of this:

1. Is the Panorama focal length more accurate than that in the EXIF data?

2. Does the FOV figure in the panorama relate to the panorama focal length (not to that in the original EXIF data)?

3. When the panorama is not 360 deg, can a focal length be imposed on the panorama (e.g. can I force it to try to create a panorama with the original EXIF data focal length)?

As an overview of my problem, I need to be able to calculate the viewing distance of a printed version of the panorama (at a given print size) to replicate the size of the objects as closely as possible when seen by an individual with the naked eye at the place the photographs were taken. To do this, i need to know what the focal length is. Therefore i need to know whether the panorama focal length or the original photograph focal length is the more accurate focal length to use for this purpose.

Many thanks again for any help with this.

Posted: Mon Oct 18, 2010 11:00 am
KJJones1974 wrote:1. Is the Panorama focal length more accurate than that in the EXIF data?

It's not that simple! Exif focal length precision depends on the camera and depends on the lens. For example for Zuiko lenses on Olympus cameras it's clearly better than for brand X lenses on brand Y cameras...

On the other side Autopano computed focal length is better for 360 deg x 180 deg panos than for 360 deg only panos. In other circumstances, I believe but never verified that the wider the panorama FOV the better the computed focal length precision.

KJJones1974 wrote:2. Does the FOV figure in the panorama relate to the panorama focal length (not to that in the original EXIF data)?

Though an "equivalent focal length" could be computed for panoramas where FOV is lower than 180 deg, Autopano indicated FOV corresponds to the panorama horizontal field of view (while the lens specified FOV in tech data sheets is the diagonal FOV.)

Theta Min, Max and Phi Min, Max in the lower right corner of the Editor window are the horizontal and vertical FOV between the Center point and the four sides of the pano

KJJones1974 wrote:3. When the panorama is not 360 deg, can a focal length be imposed on the panorama (e.g. can I force it to try to create a panorama with the original EXIF data focal length)?

I know that when one replaces an Exif focal length by a faked value like 1000 mm and deselects the Lens distortion correction option, the focal length remains unchanged. For other situations I don't know (but know that if you want an exact reproduction you should not do that because the rectilinear projection would not be followed anymore...)

KJJones1974 wrote:As an overview of my problem, I need to be able to calculate the viewing distance of a printed version of the panorama (at a given print size) to replicate the size of the objects as closely as possible when seen by an individual with the naked eye at the place the photographs were taken. To do this, i need to know what the focal length is. Therefore i need to know whether the panorama focal length or the original photograph focal length is the more accurate focal length to use for this purpose.

I would compute the eye to print distance using:
- the vertical distance between the Center point and the top side of the print (or any other side)
- the Phi Max value (or any other of the Theta or Phi, Min or Max angle)
- basic trigonometry.

Beware ! You must take into account the projection mode your are using and the Center point location.

Neglecting them would cause much larger errors than Exif approximations and Autopano approximations. If prints are placed on flat surfaces (like a wall) the rectilinear (aka planar) projection mode is to be used and the center point must be located at the same height than the viewer eyes on a line perpendicular to the wall surface.

Posted: Mon Oct 18, 2010 11:15 am
I suggest this procedure :

1) shoot a 360 pano with fixed focal.
2) create the pano - you should get an "exact" value.
3) with a subset of these images create a rectilinear pano

Is the focal length constant within a pano for all images ?
Is the focal length the same for 2) and 3) ?

Posted: Mon Oct 18, 2010 12:31 pm
Thank you both,

Generally, the focal length remains the same throughout the photos/panorama, but sometimes, even though the EXIF data says the focal length is constant between photos (and probably is), the focal length does vary in the 'adjusted focal length'. I guess i then need to make a decision on what figure is likely to be the most accurate representation of the focal length in these situations (based on the range of adjusted focal lengths)

I like the idea of shooting the 360 deg panorama (even if i don't need it) as this will help verify the most accurate focal length (as i understand it) and as I don't trust the EXIF data 100% on my Samsung GX-10. Does this sound like a sensible way to indicate the most 'trustworthy' focal length for the purposes of calculating the viewing distance of the print?

I want the 'scale' to remain the same across and up/down the print, as if the viewer of the print was inside a ball and the inside of the ball was printed withe the panorama (although only 360 deg horizontally). Effectively, such that the viewer can look at any part of the print (at the same distance) and the scale will be accurate - therefore I assume that spherical projection is the most suitable, rather than planar?

Many thanks

Karl

Posted: Mon Oct 18, 2010 2:37 pm
KJJones1974 wrote:I want the 'scale' to remain the same across and up/down the print, as if the viewer of the print was inside a ball and the inside of the ball was printed withe the panorama (although only 360 deg horizontally). Effectively, such that the viewer can look at any part of the print (at the same distance) and the scale will be accurate - therefore I assume that spherical projection is the most suitable, rather than planar?

If you want the 'scale' to remain the same across and up/down the print you should:
- project (rather than print) images on a sphere if using spherical projection (yes, that's difficult but this is how an IMAX dome works)
- print images on ordinary paper sheets but glue them on the interior face of a cylinder if using cylindrical projection (the cylinder radius must correspond to the panorama FOV, viewer must be next to the center, this was done for painted panoramas and cycloramas in the 19-th century, search these words in Wikipedia if interested)
- print on ordinary paper sheets and display them on a flat wall if using planar projection.

That objects on a rectilinear image are seen at the right size when said image is seen from the right place is not obvious but derives from the fact that the more distant an object is from the camera the more distant must be the corresponding image part from the (appropriately located) viewer.

Posted: Mon Oct 18, 2010 2:47 pm
KJJones1974 wrote:Does this sound like a sensible way to indicate the most 'trustworthy' focal length for the purposes of calculating the viewing distance of the print?

I want the 'scale' to remain the same across and up/down the print, as if the viewer of the print was inside a ball and the inside of the ball was printed withe the panorama (although only 360 deg horizontally). Effectively, such that the viewer can look at any part of the print (at the same distance) and the scale will be accurate - therefore I assume that spherical projection is the most suitable, rather than planar?

Hey Karl!

Doing measurements and/or getting exact (!) values for focal-lenghts canÂ´t be reliable in a stitched pano because - as was mentioned already - to build a sphere single images have to be a bit distorted to match the sphere. ThatÂ´s nearly invisible but also nearly inavoidable.

The only way to get reliable and measurable results is the use of a calibrated scanner-camera like a Spheron or a Seitz Roundshot for example.
Here the pano is "recorded" in one piece and doesnÂ´t have to de-formed to match a sphere.
These cameras are very expensive - between 30000.- and 50000.-â‚¬.

I donÂ´t know whether you meant those things . . ?

best, Klaus

Posted: Mon Oct 18, 2010 3:48 pm
Remember, the EXIF focal length data is approximate on a zoom lens. Try it on your lens. Take 4 or 5 shots, zooming by 5% or 10% between shots. Or take 10 shots incrementing the zoom by 10% and see how many EXIF values you get.

Posted: Mon Mar 28, 2011 4:02 pm
Hi all,

Many thanks for the replies on this original post - these were very helpful. I have just upgraded to Autpano Giga v2.5.0 and the 35mm focal length equivalent that is presented to me after the panorama has been detected and compiled is much higher than I would expect AND than i get for exactly the same panorama (using the same settings) in Autopano Giga v2.0.9.

For example: the actual focal length (exif) is 31.98mm, with the 1.532x conversion multiplier this is 49mm (approx.). When the panorama is created, the 35mm equivalent focal length shown is:

In v2.0.9: 54.96mm (not too different to the original in the exif data).
In v2.5.0: 66.62mm (quite a difference!)

Why would this be? This is worrying, as i use the focal lengths to determine the viewing distance and fields of view of a panorama for printed versions.

Any help on this would be much appreciated.

Thanks

Karl

Posted: Wed Mar 30, 2011 3:13 pm
Are you using a panohead and have you set up the NPP correctly? APP has to guess at the lens length, and if the NPP of the lens moves, then APP may guess a different focal length.

Imagine shooting an arc of a circle. APP assumes the size of the circle, and that the NPP is at the center of the circle. If you shoot left to right, and then move the camera from left to right as you take the picture, the center of the circle will be behind you. So APP thinks the pictures are further away, and changes the focal length accordingly. And if you remember your trigonometry, a small left to right change may give a big change in the length to the subject.

Posted: Thu Mar 31, 2011 8:33 am
Just to clarify a point: KJJones1974, you are saying that you are getting a noticeable difference in the calculated focal length between 2.0.9 and 2.5.0 using the same images in both cases? (So, it seems, the issue is with versions of APG not how you took the images...)

Posted: Thu Mar 31, 2011 8:44 am
Thank you (both) for responding.

To confirm - I did not use a panohead, so i am expecting some margin of error in focal length calculation due to this, and (hankarl) your explanation of APP's assumption on the centre of the circle is useful for me to help undersand differences between actual and calculated focal lengths, but yes (Leedsjoe), what i can't understand is why there is such a difference between the calculated focal lengths between APG v2.0.9 and APG v2.5.0, for the same images/panorama/settings. There may not be an issue with the new version (but I can't discount this) but I can't see an obvious reason why they should be different.

The only thing that I can see that is different is that the camera (Samsung GX-10) and lens combination is not seen in the same way by both versions of APG (it mixes up 35mm equivalent with actual focal length in the newer APG version), but if i set this manually in the same way in both versions of APG, i still see the difference in calculated focal lengths (a difference which I can't ignore!).

Posted: Thu Mar 31, 2011 3:32 pm
The focal estimation is really a hard job when having partial panorama. A small variation of focal doesn't affect at all the RMS. The optimizer really needs a large variation of the focal to see that in the focal dimension, it reached an optimum.
In practice, the result of that is some variation of the calculated focal compared to initial focal given by the camera. This variation is small when beeing at the non parallax point, and can be large when shooting handheld.
Most of time, it doesn't affect at all the quality of the stitch. In fact, it may even help to compensate the parallax caused by handheld photography. What we solves when doing camera estimation is finding the pose that minimize the visual error. If the optimize answer is a longer focal, let it be that way, because the calculation says that globally, the matching quality is better by using this focal.

This debate is totally not true when talking about a 360° panorama. The closure of the panorama pushes an extremely strong constrains on the focal and here, the only answer to the "minimize the visual error" is the real focal length. No other solution here.

Posted: Fri Apr 01, 2011 7:42 am
Thank you AlexandreJ. It is clear that I need to take 360deg panoramas (even when i don't need to) if I want to try to extract an 'as accurate as can be expected' focal length (and FOVs). Is the focal length given by APG (in a 360 deg panorama) likely to be at least as accurate as the manufacturer's stated focal length of a lens (I know this can be slightly different in reality)?

Irrespective of this, surely the same focal length should be stated by APG v2.0.9 and APG v2.5.0, for the same images/panorama/settings?

Posted: Fri Apr 01, 2011 8:15 am
At this point I think I should say (or confess) that I have a degree in philosophy! Why say this? Because I think there a possible point here that has been missed.

I think Alexandre's post is saying that the focal length that the user finds in the data in APG is not an input value but an output one. APG algorithms use the input data available (from the images and the EXIF data, if there) to "minimise the visual error". When that process has finished APG records the calculated focal length that corresponds to that minimum.

If I have got this right then when APG's algorithms change - say between versions, it may well be that the calculated focal length also changes.

But the aim of the exercise is to get the 'best' panorama produced given all the data available which may or not result in the input focal and output focal being the same.

Alexandre: have I got this right?

Posted: Fri Apr 01, 2011 9:05 am
leedsjoe wrote:I think Alexandre's post is saying that the focal length that the user finds in the data in APG is not an input value but an output one. APG algorithms use the input data available (from the images and the EXIF data, if there) to "minimise the visual error". When that process has finished APG records the calculated focal length that corresponds to that minimum.

That's more or less the same thing I wrote like 6 months back, see the top of the thread And yes, that is the case.

Posted: Fri Apr 01, 2011 9:13 am
leedsjoe wrote:If I have got this right then when APG's algorithms change - say between versions, it may well be that the calculated focal length also changes.
But the aim of the exercise is to get the 'best' panorama produced given all the data available which may or not result in the input focal and output focal being the same.

Yes, that's right. When doing panorama, we don't always search for accurate focal calculation ( in partial panorama ), but for something that is visually nice.
Yes, it changes between version and in v2.6, it will change a little again ( because we are adjusting the optimizer algorithm ).
Nevertheless, this is only true for non 360° panorama.

Posted: Fri Apr 01, 2011 9:34 am
Thank you all. I think I understand things better now. The algorithm used for the calculation has changed between versions and the calculated focal length figure is largely incidental in absolute terms (and is probably not particulalrly accurate to reality in my handheld shots unless it is a 360deg panorama). Therefore (I assume) it follows that the FOV figures relate to this incidental focal length.

I do find it a little strange though that the newer algorithms suggest a focal length which is further away from/less accurate than the actual focal length used, than the previous algorithms.

As i want to be able to obtain accurate FOVs and focal length figures AND a 'visually nice' result (I want it all i know!), i can see that i will need to always produce 360deg panoramas.

Thanks again.

Posted: Fri Apr 01, 2011 12:21 pm
KJJones1974 wrote:As i want to be able to obtain accurate FOVs and focal length figures AND a 'visually nice' result (I want it all i know!), i can see that i will need to always produce 360deg panoramas.

I'm curious to know which projection you are using for your non-360x180 panos.

If you are using planar (aka rectilinear) projection then I would share your concern as a wrong FOV being used by Autopano will result in some straight lines in the subject being curved in the corresponding pano image.

If you are using any other of the available projections (they all use an "unwraped cylinder" - the way the vertical scale is handled is the only difference between them) you should acknowledge that any projection is a convention, usual rectilinear projection included!

I'm curious to know leedsjoe's opinion too, as we now know there is a philosopher in this plane

Posted: Fri Apr 01, 2011 5:32 pm
AlexandreJ wrote:The focal estimation is really a hard job when having partial panorama. A small variation of focal doesn't affect at all the RMS. The optimizer really needs a large variation of the focal to see that in the focal dimension, it reached an optimum.
In practice, the result of that is some variation of the calculated focal compared to initial focal given by the camera. This variation is small when beeing at the non parallax point, and can be large when shooting handheld.
Most of time, it doesn't affect at all the quality of the stitch. In fact, it may even help to compensate the parallax caused by handheld photography. What we solves when doing camera estimation is finding the pose that minimize the visual error. If the optimize answer is a longer focal, let it be that way, because the calculation says that globally, the matching quality is better by using this focal.

This debate is totally not true when talking about a 360° panorama. The closure of the panorama pushes an extremely strong constrains on the focal and here, the only answer to the "minimize the visual error" is the real focal length. No other solution here.

OK, but what is a "small variation"? An experienced photographer will shoot a handheld partial pano and try and keep the NPP in one place ( for example, he may try rotating about the ball of his foot). A not so experienced photographer will stand in one place and turn in a circle.

The experienced guy may keep the NPP of the lens within a 4 inch circle. The other guy will turn the NPP around a circle that may be 18 inches in diameter. And then add pitch, roll and yaw