mve
mve copied to clipboard
How to convert Eigen into .mvei format?
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?
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.
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?
That's application-specific, I can't help you with that. But isn't this just a bit of trigonometry?
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:
This is the content of the .mvei file obtained using the method in MVE: