freealise commited on
Commit
010a3dc
1 Parent(s): 75a13ed

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -5
app.py CHANGED
@@ -196,6 +196,8 @@ def pano_depth_to_world_points(depth, scale):
196
  lon = np.linspace(0, np.pi*2, depth.shape[1])
197
  lat = np.linspace(0, np.pi, depth.shape[0])
198
  lon, lat = np.meshgrid(lon, lat)
 
 
199
 
200
  pts3d = [[0,0,0]]
201
  uv = [[0,0]]
@@ -205,13 +207,11 @@ def pano_depth_to_world_points(depth, scale):
205
  #rnd_lat = (np.random.rand(depth.shape[0]*depth.shape[1]) - 0.5) / 8
206
  d_lon = i/4 * np.pi*2 / depth.shape[1]
207
  d_lat = j/4 * np.pi / depth.shape[0]
208
- lon = lon.flatten() + d_lon
209
- lat = lat.flatten() + d_lat
210
 
211
  # Convert to cartesian coordinates
212
- x = radius * np.cos(lon) * np.sin(lat)
213
- y = radius * np.cos(lat)
214
- z = radius * np.sin(lon) * np.sin(lat)
215
 
216
  pts = np.stack([x, y, z], axis=1)
217
  uvs = np.stack([lon, lat], axis=1)
 
196
  lon = np.linspace(0, np.pi*2, depth.shape[1])
197
  lat = np.linspace(0, np.pi, depth.shape[0])
198
  lon, lat = np.meshgrid(lon, lat)
199
+ lon = lon.flatten()
200
+ lat = lat.flatten()
201
 
202
  pts3d = [[0,0,0]]
203
  uv = [[0,0]]
 
207
  #rnd_lat = (np.random.rand(depth.shape[0]*depth.shape[1]) - 0.5) / 8
208
  d_lon = i/4 * np.pi*2 / depth.shape[1]
209
  d_lat = j/4 * np.pi / depth.shape[0]
 
 
210
 
211
  # Convert to cartesian coordinates
212
+ x = radius * np.cos(lon + d_lon) * np.sin(lat + d_lat)
213
+ y = radius * np.cos(lat + d_lat)
214
+ z = radius * np.sin(lon + d_lon) * np.sin(lat + d_lat)
215
 
216
  pts = np.stack([x, y, z], axis=1)
217
  uvs = np.stack([lon, lat], axis=1)