Skip to content

Use of the focal length when computing gnomonic projection #6

@lukkio88

Description

@lukkio88

Hi,

I'm currently using libgnomonic to perform a gnonominc projection. I cannot find a derivation of the used formulas. But they don't seem to be particularly involved and there's a specific bit I'd like to understand.

More specifically this function, has a conversion from 2D to 3D that doesn't quite convince me, I'll report the specific bit for convenience:

 /* Compute pixel position in 3d-frame */
lgPvi[0] = lgFocal;
lgPvi[1] = lgPixel * ( lgrPointX - lgrSightX );
lgPvi[2] = lgPixel * ( lgrPointY - lgrSightY );

Also I don't know if this is relevant but they compute a focal length from aperture angle, the computation is :

lg_Real_s( 2.0 ) * tan( lgApper / lg_Real_s( 2.0 ) ) / lgrWidth

Which is actually the inverse of a focal length, unless I'm wrong.

In few words if we have a point in the image plane of coordinates (x,y)

the 3D point, still in the plane, is constructed with a mapping:

(x,y)→(x,y,f)

Where f

is the focal length, this would be the case if the used projection were orthographic, but the is explicitly said that the projection used is perspective, there fore to me the correct conversion should be

(x,y)→(fx,fy,f)

Details:

The function perform a transformation between pixel coordinates from perspective projection to (azimuth,elevation) in a equirectangular image.

All the math should be trivial trigonometry.

But anyway since the function works I only want to know one thing:

Why isn't the focal length used to rescale the (x,y)
pixel coordinates?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions