MCPcopy Create free account
hub / github.com/cdcseacave/openMVS / exportDMAPContent

Function exportDMAPContent

scripts/python/MvsReadDMAP.py:17–26  ·  view source on GitHub ↗
(dmap_path)

Source from the content-addressed store, hash-verified

15import pyvips
16
17def exportDMAPContent(dmap_path):
18 dmap = loadDMAP(dmap_path)
19
20 basename = os.path.splitext(os.path.basename(dmap['file_name']))[0]
21
22 pyvips.Image.new_from_array(np.uint8(dmap['depth_map'] * (1 / dmap['depth_max']) * 255)).write_to_file('%s_depth_map.png' % basename)
23 if dmap['has_normal']:
24 pyvips.Image.new_from_array(np.uint8((dmap['normal_map'] @ -dmap['R'] + 1) * 0.5 * 255)).write_to_file('%s_normal_map.png' % basename)
25 if dmap['has_conf']:
26 pyvips.Image.new_from_array(np.uint8(dmap['confidence_map'] * (1 / dmap['confidence_map'].max()) * 255)).write_to_file('%s_confidence_map.png' % basename)
27
28def main():
29 parser = ArgumentParser()

Callers

nothing calls this directly

Calls 2

loadDMAPFunction · 0.90
maxMethod · 0.45

Tested by

no test coverage detected