Max Lyons Forums Forum Index Max Lyons Forums
Panoramic and Related Photography | Subscribe
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Equisolid fisheye FOV is wrong.

 
Post new topic   Reply to topic    Max Lyons Forums Forum Index -> PTAssembler, Panorama Tools and Other Software
View previous topic :: View next topic  
Author Message
TKSharpless



Joined: 23 Jan 2006
Posts: 25
Location: Philadelphia PA

PostPosted: Tue Jul 21, 2009 11:18 pm    Post subject: Equisolid fisheye FOV is wrong. Reply with quote

Hi Max,

While revising autopano-sift-c to work with PTAssembler project files, I noticed (for the first time) that PTAsm lets you specify whether a fisheye lens is of the equal-angle or equal-area (equisolid-angle) type. Neither Hugin nor PTGui does that.

However I was disappointed to see that PTAsm computes the hfov wrong for the equisolid case -- the reported fov corresponds to the 35mm equivalent f.l. instead of the actual one. And this bad hfov value goes into the project file.

I would also like to suggest to you, as I am to everyone who develops PT family software, that we stop using hfov to specify angular resolution, and store primary data (lens focal length plus either crop factor or focal plane pixel spacing) in our project files
(or even better, store the focal length in pixels, which is the quantity all angle calculations depend on).

Because hfov also depends on an image dimension and the lens projection function, both of which are inadequately specified in the PT script scheme, it can be hard to get the right focal length in pixels when you need it; and all sorts of confusion and trouble arise, both for users and programmers. Sticking to independent primary data, and computing secondary quantities like hfov from those as and when needed, would go a long way toward clearing that up.

Working with Hugin, PTAsm and PTGui project files side by side has only confirmed my conviction that something needs to be done about this, and soon. It is unbelievable how many kluges and unsafe assumptions one must make when passing "hfov" around a tool chain.

For example: if the EXIF specifies an image orientation, PTGui not only displays it that way, but also records its dimensions that way in the project file, along with the corresponding hfov. So then to figure the "real hfov" one has to compare the dimensions recorded in the project to the ones in the image file, and make an adjustment if they disagree.

For example: many a user of Hugin has had the bad experience of having image alignment go all to pieces when he crops an image, for that changes the calculated hfov -- though not, of course, the angular resolution of the image.

For example: PTGui assumes all fisheyes are equal-area, and calculates hfov on that basis; Hugin assumes they are equal-angle, and uses that formula to compute hfov. So if you put Hugin's hfov into PTGui, or vice versa, each will display an incorrect lens focal length (and both will use wrong image angles).

I could go on for many pages. The bottom line is I'm fed up with flaky kluges and yearning for some simplicity and order. What do you say?

Best Regards, Tom
Back to top
View user's profile Send private message Visit poster's website
Bart



Joined: 10 Jun 2006
Posts: 44

PostPosted: Sun Aug 16, 2009 10:50 am    Post subject: Re: Equisolid fisheye FOV is wrong. Reply with quote

TKSharpless wrote:
I would also like to suggest to you, as I am to everyone who develops PT family software, that we stop using hfov to specify angular resolution, and store primary data (lens focal length plus either crop factor or focal plane pixel spacing) in our project files (or even better, store the focal length in pixels, which is the quantity all angle calculations depend on).


I agree that, if all developers would adopt it (as an alternative to maintain backwards compatibility), the physical X & Y sensel spacing would offer flexible parameters. That would allow to also calculate a correct FOV for portrait/landscape orientation, and even for cropped images.

One of the issues of course is how to derive that info in case the EXIF is not offering enough info, or has incorrect EXIF info in the case of cropped images. So, from a programming POV, several cross checks need to be performed to verify the validity of EXIF data.

The most accurate info comes from the EXIF's "FocalPlaneXResolution" and FocalPlaneYResolution tags.

When the EXIf is not present or damaged, the simplest approximation is IMHO based on the actual effective sensor array dimensions divided by the maximum native file output size in pixels. That yields an approximated sensel pitch, also for non-square sensels, or even binned sensels(!) which I expect to be introduced soon.

The user could either enter that dimension info manually, together with the nominal focal length, all in millimetres. That data is available from various sources, or a database could be built based on camera model, giving the sensor array dimensions, and the number of pixels for each dimension.

Once that info is cross-checked with the EXIF's "FocalPlaneXResolution" and FocalPlaneYResolution tags if available, a decision can be made about which X & Y resolutions to store in a project.

Together with the lens projection function (for non rectilinear lenses), that would allow the applications to calculate all other values.

Kind regards,
Bart
Back to top
View user's profile Send private message
maxlyons



Joined: 20 Jun 2003
Posts: 3347
Location: USA

PostPosted: Sun Aug 16, 2009 10:49 pm    Post subject: Re: Equisolid fisheye FOV is wrong. Reply with quote

TKSharpless wrote:
However I was disappointed to see that PTAsm computes the hfov wrong for the equisolid case -- the reported fov corresponds to the 35mm equivalent f.l. instead of the actual one. And this bad hfov value goes into the project file.


At the moment, PTAssembler can only calculate FOV correctly from two types of lenses:

1. Rectilinear lenses
2. Equidistant Fisheye lenses

You argued that the error was because "fov corresponds to the 35mm equivalent f.l. instead of the actual one". In fact, the real problem is that PTAssembler silently reverts to calculating the FOV using the rectilinear formula for lens types for which it can't do the appropriate calculation.

I'll add in the appropriate logic to let it handle the equisolid fisheye case as well. I'll use the formula specified in the footnotes to this Wiki page. It should be in the next beta version of PTAssembler.

Max
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Max Lyons Forums Forum Index -> PTAssembler, Panorama Tools and Other Software All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group