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

Obraining depth maps from raw data #14

Open
VladimirYugay opened this issue May 17, 2021 · 0 comments
Open

Obraining depth maps from raw data #14

VladimirYugay opened this issue May 17, 2021 · 0 comments

Comments

@VladimirYugay
Copy link

VladimirYugay commented May 17, 2021

Hey there,

I currently have some raw depth maps (.raw files) from the GTA game engine and I'm curious, how did you get the depth images that you have in samples?

I was able to convert them to (0, 255) color images with the following function, but still can't get the depth in meters like you have.

def convert_depth(img_path):
    abs_min = 1008334389
    # sky =  964405378
    abs_max = 1067424357
    x = np.fromfile(img_path, dtype='uint32')[4:]
    x = np.clip(x, abs_min, abs_max)
    x = ((x - abs_min) / (abs_max - abs_min))
    x = np.uint8(x * 255)
    x = x.reshape(1080, 1920)
    return x

Thanks!

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

1 participant