Export depth maps to .png

Hi everyone,

I am very new to ODM so please forgive me if this is more suited to OpenMVS.

I ran the ODM(2.8) workflow via docker with WSL2 for a project (154 drone images) that produced a dense point cloud and associated depth maps. From my understanding, depth estimation is done in OpenMVS and output as .dmap files.

I am working on an application to measure directly from images utilizing the associated depth map but need the depth data in .png format.

I noticed in the OpenMVS source code that there are two functions that may do this: DepthMap2Image and ExportDepthMap.

Would I be able to specify the output file format for depth maps in the ODM command line call?

If not, could I call the OpenMVS functions with the ODM docker image?

Thank you in advance.

1 Like

Adding this post from the OpenMVS Issues. It looks like depth maps can be exported as .png with the following solution:

Providing -v 4 to DensifyPointCloud will export the depth and normal maps as PNGs.

If anyone could help me with the syntax of calling the DensifyPointCloud function via the command line in the ODM docker image it would be very much appreciated.

1 Like


I think for this you’d have to modify the code to add this command when we call OpenMVS for densficiation, unfortunately…

Okay, thanks for letting me know! I’ll go ahead and try that. It the implementation works out, would including the option for exporting depth maps be a good contribution to ODM additional parameters?

1 Like

We love and welcome contributions, so thank you so much for taking the time/effort to consider it for us!

Whether or not we should add it as an additional parameter is a bit of a question of balance… We’re trying to only expose however many parameters folks need for what are our typical workflows within our Community.

That being said, we do have a few config files that folks can (and do) edit manually for less-common (but still wanted) workflows.

Do you think that approach would work for you and your intended workflow? How about feasibility for your coding level and time/effort availability?

1 Like

Sure, an editable config file sounds like it may be a good solution here.

I will have to take more time to dive into the source code before determining if this is beyond my abilities right now. I have a solid understanding of Python but am not comfortable doing any heavy lifting in C++ (OpenMVS).

If we could host an ODM container with a custom config to output depth as .png, or even to convert .dmap to .png after the ODM workflow, that would be amazing.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.