mve icon indicating copy to clipboard operation
mve copied to clipboard

How to convert Eigen into .mvei format?

Open lowerfain opened this issue 2 years ago • 4 comments

Hello, I tried to add another MVS to dmrecon, and the depth map it returned is an Eigen matrix(Eigen::MatrixXf). I intend to continue to use scene2pset and so on. So is there a way to convert Eigen into the input format of scene2pset?

lowerfain avatar Sep 26 '22 04:09 lowerfain

If your Eigen matrix is just a depth map, it should be fairly straightforward to output it to a file. Use the .mvei file format (code here) to output a floating point image and call it, e.g., depth-L0.mvei (where the number after L corresponds to the size relative to the original image, in octaves).

Once you put a depth map image into the directory for the view, scene2pset will be able to read it.

Also make sure you're storing the depth map with the correct conventions. See here for more details.

simonfuhrmann avatar Sep 27 '22 18:09 simonfuhrmann

If your Eigen matrix is just a depth map, it should be fairly straightforward to output it to a file. Use the .mvei file format (code here) to output a floating point image and call it, e.g., depth-L0.mvei (where the number after L corresponds to the size relative to the original image, in octaves).

Once you put a depth map image into the directory for the view, scene2pset will be able to read it.

Also make sure you're storing the depth map with the correct conventions. See here for more details.

Thank you for your recovery. My Eigen matrix stores disparity map, so I need to convert it into depth map. So is there a function of converting disparity map into depth map in MVE? Or how do I get the baseline distance?

lowerfain avatar Sep 28 '22 12:09 lowerfain

That's application-specific, I can't help you with that. But isn't this just a bit of trigonometry?

simonfuhrmann avatar Sep 29 '22 06:09 simonfuhrmann

My approach is to convert the disparity map to a depth map, then save the depth map in PNG format, use load_png_file() to read the PNG image into ByteImage, and then use save_mvei_file() to save it as .mvei format. But the data in the .mvei I get is only two lines, I don't know where is the problem, or is my method wrong? This is the content of the .mvei file I get: 1664508957248

This is the content of the .mvei file obtained using the method in MVE: 1664509282581

lowerfain avatar Sep 30 '22 03:09 lowerfain