Added GUI
This commit is contained in:
parent
ae9774cf0d
commit
74df5cb3f0
23 changed files with 3174 additions and 2 deletions
31
utils/util.py
Normal file
31
utils/util.py
Normal file
|
@ -0,0 +1,31 @@
|
|||
import numpy as np
|
||||
|
||||
|
||||
def sperical2equirec(theta, phi, img_w, img_h):
|
||||
u = np.deg2rad(theta) / (2 * np.pi)
|
||||
v = np.deg2rad(phi) / np.pi
|
||||
|
||||
x = u * img_w
|
||||
y = v * img_h
|
||||
return x, y
|
||||
|
||||
|
||||
def equirec2spherical(x, y, img_w, img_h):
|
||||
# Normalize coordinates
|
||||
u = x / img_w
|
||||
v = y / img_h
|
||||
|
||||
# Calculate spherical coordinates from normalized coordinates
|
||||
# theta is horizontal angle, phi is polar angle
|
||||
theta = u * 2 * np.pi
|
||||
phi = v * np.pi
|
||||
|
||||
return np.rad2deg(theta), np.rad2deg(phi)
|
||||
|
||||
|
||||
def get_circle(radius):
|
||||
""" helper function returns circle to x, y coordinates"""
|
||||
theta = np.linspace(0, 2 * np.pi, 100)
|
||||
x = radius * np.cos(theta)
|
||||
y = radius * np.sin(theta)
|
||||
return np.array(x), np.array(y)
|
Loading…
Add table
Add a link
Reference in a new issue