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

Function load_depth_npy

scripts/python/ImportDMAPs.py:21–35  ·  view source on GitHub ↗

Load depth data from an NPY file. Args: exr_path (str): Path to the NPY file. Returns: numpy.ndarray: Depth data as a NumPy array.

(exr_path)

Source from the content-addressed store, hash-verified

19
20
21def load_depth_npy(exr_path):
22 """
23 Load depth data from an NPY file.
24 Args:
25 exr_path (str): Path to the NPY file.
26 Returns:
27 numpy.ndarray: Depth data as a NumPy array.
28 """
29 try:
30 depth_map = np.load(exr_path)
31 depth_map = np.nan_to_num(depth_map, nan=0.0, posinf=0.0, neginf=0.0)
32 return depth_map
33 except Exception as e:
34 print(f"Error loading NPY file {exr_path}: {e}")
35 return None
36
37
38def load_depth_exr(exr_path):

Callers 1

import_dmapsFunction · 0.85

Calls 2

printFunction · 0.85
loadMethod · 0.45

Tested by

no test coverage detected