Skip to content
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

Open
nita-xwj opened this issue May 30, 2023 · 1 comment
Open

how to read .dpt file? #60

nita-xwj opened this issue May 30, 2023 · 1 comment

Comments

@nita-xwj
Copy link

nita-xwj commented May 30, 2023

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.
@liuyuzhenn
Copy link

Hi, have you solved this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants