0

I am looking to plot out points on a 2d spherical image from a GoPro Max given an Altitude° and an Azimuth°.

Here's what you can assume:

  1. The center of the image is always facing south
  2. the image is always level looking straight at the equator.

Here's what I know:

  1. The image size is 5760x2880 which means the equator is at 1440px vertically.
  2. I have found an image online and labeled it with the Azimuth° going left to right and the Altitude° going up and down. You can find that image here

I hope that this will give you a better idea of what I'm trying to do here.

Put simply, I'm imagining a method something like:

ConvertCoords(Azimuth°, Altitude°){
     ...
     return (x,y)
}

Is this possible? I will probably implement this using Python but I'm open to suggestions. Any sort of information to point me in the right direction is greatly appreciated!

Edit: I should mention that from my research I believe the GoPro Max uses an equirectangular projection. I was able to overlay that image I attached on one of the 360 photos and plot out some data manually which seemed to come out correct.

eyllanesc
  • 235,170
  • 19
  • 170
  • 241
FancyAM
  • 1
  • 1
  • Your code snippet looks like C. Are you really looking for Python? – Tim Roberts Oct 27 '21 at 22:12
  • You have to know which projection you want. There are dozens. Is this Google's equi-angular cube map? – Tim Roberts Oct 27 '21 at 22:19
  • @TimRoberts I do mean Python. I apologize I was just being overly simple. I believe the the projection that I'm looking for is an equirectangular projection. I got that original image from here: https://dmswart.com/2016/06/28/drawing-a-panorama/ and labeled it using imaging software. – FancyAM Oct 27 '21 at 22:22

1 Answers1

1

With an equirectangular projection, the mapping is direct and linear.

def convertCoords( azimuth, altitude ):
    # Assumptions:
    # - Both values are in radians
    # - South is an azimuth of 0, negative to the left, range -pi to +pi
    # - Altitude range is -pi/2 to +pi/2, negative down
    x = 2880 + (azimuth * 2880 / math.pi)
    y = 1440 - (altitude * 2880 / math.pi)
    return x,y

If you'd rather use degrees, change "math.pi" to "180".

Tim Roberts
  • 48,973
  • 4
  • 21
  • 30
  • Thank you so much for taking the time for providing me with an answer! After looking at it though, I'm afraid this isn't correct. If you look at the image I provided and look at South (180°) for example, and go up in altitude 30°. From that point, as you go either to the left or the right (azimuth-- or azimuth++) you can see the 30° line curves downward until you reach 135° or 225° azimuth then it starts to curve back upward. Your solution doesn't (for lack of a better term) warp the x-axis correctly. Or perhaps I should say it doesn't warp the altitude y pixel location correctly. Thanks Again – FancyAM Oct 27 '21 at 23:34