Convert cylindrical pano x and y pixel position to polygon hotspot ath and atv coordinate

  • Hi,

    I'm a longtime very happy krpano user, but never posted on the forums before.

    I have a 360 degree cylindrical gigapixel. The image size is 250,000 x 50,000 pixels in cylindrical projection. I want to know how to calculate the pixel position of my image to ath, atv of a polygon hotspot.

    For example, I know that if x = 125,000, and y = 25,000 then I should get ath = 0 and atv = 0.

    But how do I calculate it for other positions? Like say what is the ath and atv of x = 50,000 and y = 40,000?


    I want to do this but with a cylindrical pano: http://www.krpano.com/forum/wbb/inde…49963#post49963

  • Hi,

    there is a 'linear' relation between the pixel x/y and the ath/atv coordinates.

    e.g.
    ath = ((x / width) - 0.5) * hfov
    atv = ((y / height) - 0.5) * vfov

    The hfov would be 360 for a cylindrical pano that covers the full 360 degree around and the vfov could either taken from the xml file or manually calculated this way:

    For spherical:
    vfov = 360 * height/width

    For cylindrical:
    vfov = 360 * arctan( height/width * PI ) / PI

    Best regards,
    Klaus

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!