(equirect)
| 22 | |
| 23 | |
| 24 | def Pixel2LatLon(equirect): |
| 25 | # LatLon (H, W, (lat, lon)) |
| 26 | h, w = equirect.shape |
| 27 | |
| 28 | Lat = (0.5 - np.arange(0, h)/h) * np.pi |
| 29 | Lon = (np.arange(0, w) / w - 0.5) * 2 * np.pi |
| 30 | |
| 31 | Lat = np.tile(Lat[:, np.newaxis], w) |
| 32 | Lon = np.tile(Lon, (h, 1)) |
| 33 | |
| 34 | return np.dstack((Lat, Lon)) |
| 35 | |
| 36 | |
| 37 | def LatLon2Sphere(LatLon): |