MCPcopy
hub / github.com/naver/dust3r / imread_cv2

Function imread_cv2

dust3r/utils/image.py:32–42  ·  view source on GitHub ↗

Open an image or a depthmap with opencv-python.

(path, options=cv2.IMREAD_COLOR)

Source from the content-addressed store, hash-verified

30
31
32def imread_cv2(path, options=cv2.IMREAD_COLOR):
33 """ Open an image or a depthmap with opencv-python.
34 """
35 if path.endswith(('.exr', 'EXR')):
36 options = cv2.IMREAD_ANYDEPTH
37 img = cv2.imread(path, options)
38 if img is None:
39 raise IOError(f'Could not load image={path} with {options=}')
40 if img.ndim == 3:
41 img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
42 return img
43
44
45def rgb(ftensor, true_shape=None):

Callers 12

prepare_sequencesFunction · 0.90
crop_one_seqFunction · 0.90
_get_viewsMethod · 0.90
_get_viewsMethod · 0.90
_get_viewsMethod · 0.90
_get_viewsMethod · 0.90
_get_viewsMethod · 0.90
_get_viewsMethod · 0.90
_read_depthmapMethod · 0.90
_get_viewsMethod · 0.90
_read_depthmapMethod · 0.90
img_to_arrFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected