You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
got a .dpt file,which is the ground-truth depth of 360 RGB scene, but when I use Hinterstousser to read dpt file, it goes wrong.Here is the code:
*```
INT_BYTES = 4
USHORT_BYTES = 2
def load_hinter_depth(path):
'''
Loads depth image from the '.dpt' format used by Hinterstoisser.
'''
f = open(path, 'rb')
h = struct.unpack('i', f.read(INT_BYTES))[0] # this output 1212500304
w = struct.unpack('i', f.read(INT_BYTES))[0] # this output 2048
depth_map = []
for i in range(h):
depth_map.append(struct.unpack(w'H', f.read(w * USHORT_BYTES)))
# return np.array(depth_map, np.uint16)
return np.array(depth_map, np.float32)
My 360 RGB PNG is 1024 height and 2048 width.When I change range(h) to range(1024), it can run, but the result array is obvious wrong.
The text was updated successfully, but these errors were encountered:
got a .dpt file,which is the ground-truth depth of 360 RGB scene, but when I use Hinterstousser to read dpt file, it goes wrong.Here is the code:
*```
INT_BYTES = 4
USHORT_BYTES = 2
def load_hinter_depth(path):
'''
Loads depth image from the '.dpt' format used by Hinterstoisser.
'''
f = open(path, 'rb')
h = struct.unpack('i', f.read(INT_BYTES))[0] # this output 1212500304
w = struct.unpack('i', f.read(INT_BYTES))[0] # this output 2048
depth_map = []
for i in range(h):
depth_map.append(struct.unpack(w'H', f.read(w * USHORT_BYTES)))
# return np.array(depth_map, np.uint16)
return np.array(depth_map, np.float32)
The text was updated successfully, but these errors were encountered: