mirror of
https://github.com/nerfstudio-project/nerfstudio.git
synced 2026-11-11 18:44:21 +08:00
Fix dycheck depth and rgb rescale (#2623)
Fix depth and rgb rescale Not sure if depth is correct since I'm not sure what the 3rd dim is for, the code runs properly though.
This commit is contained in:
parent
7a8e31d84e
commit
38fc72729c
@ -173,7 +173,10 @@ def _rescale_depth(depth_raw: np.ndarray, cam: Dict) -> np.ndarray:
|
||||
viewdirs /= np.linalg.norm(viewdirs, axis=-1, keepdims=True)
|
||||
viewdirs = viewdirs.reshape((*batch_shape, 3))
|
||||
cosa = viewdirs @ (cam["camera_to_worlds"][:, 2])
|
||||
depth = depth_raw / cosa[..., None]
|
||||
if depth_raw.ndim == cosa.ndim:
|
||||
depth = depth_raw[..., None] / cosa[..., None]
|
||||
else:
|
||||
depth = depth_raw / cosa[..., None]
|
||||
return depth
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user