-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to read .dpt file? #60
Comments
Hi, have you solved this? |
For anyone who's still wondering, here's my solution. The .dpt file has 3 data of 4 bytes at the beginning. I was expecting to get a better result with this code, but turns out that the visualization depth image was quite a precise one.
|
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: