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

Can't make sense on how to read DEPTHMAP data #18

Open
pmoulon opened this issue Oct 6, 2023 · 1 comment
Open

Can't make sense on how to read DEPTHMAP data #18

pmoulon opened this issue Oct 6, 2023 · 1 comment

Comments

@pmoulon
Copy link

pmoulon commented Oct 6, 2023

I see two piece of code to read depth_map data in the code base:
One in the readme

FILE* ground_truth_depth_file = fopen(ground_truth_depth_file_path.c_str(), "rb");
fread(gt_depth_map.data, sizeof(float), gt_depth_map.rows * gt_depth_map.cols, ground_truth_depth_file);
fclose(ground_truth_depth_file);

and one in the code

 if (fread(depth_image.data, 1, depth_image.step * depth_image.rows, file) != depth_image.step * depth_image.rows) {
      std::cout << "Error: Depth file " << face.depth_map_filename << " has unexpected size." << std::endl;
      return EXIT_FAILURE;
    }

I tried those code on the courtyard dataset and I can't seems to load correctly the depth map

From the file cameras.txt the image size are specified and I tried to use those to load the depth map but I ending up having only a noise pattern in the DEPTH.

I also tried to check how long the file is using this

fseek(file, 0, SEEK_END);
int fileSize = ftell(file);
rewind(file);
std::cout << fileSize<<std::endl;

and curiously fileSize is not matching any multiple of the image size of the dataset...

Am I doing something completely wrong?

@yezhiyun
Copy link

the size of depth Image is same as raw image size.

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