Spaces:
Runtime error
Runtime error
Commit
·
6da63eb
1
Parent(s):
5982270
Update app.py
Browse files
app.py
CHANGED
@@ -14,13 +14,11 @@ def depthMap(imgL,imgR):
|
|
14 |
stereoMatcher.setSpeckleRange(16)
|
15 |
stereoMatcher.setSpeckleWindowSize(45)
|
16 |
disparity = stereoMatcher.compute(imgL,imgR)
|
17 |
-
depth_map = np.zeros_like(disparity, dtype=np.float32)
|
18 |
-
depth_map[disparity > 0] = 0.1 * 500 / disparity[disparity > 0]
|
19 |
gray = plt.get_cmap('gray')
|
20 |
disparity = disparity - np.min(disparity)
|
21 |
disparity = disparity / np.max(disparity)
|
22 |
disparity = gray(disparity)[:, :, :3]
|
23 |
-
return
|
24 |
|
25 |
leftCam = gr.inputs.Image(type="numpy")
|
26 |
RightCam = gr.inputs.Image(type="numpy")
|
|
|
14 |
stereoMatcher.setSpeckleRange(16)
|
15 |
stereoMatcher.setSpeckleWindowSize(45)
|
16 |
disparity = stereoMatcher.compute(imgL,imgR)
|
|
|
|
|
17 |
gray = plt.get_cmap('gray')
|
18 |
disparity = disparity - np.min(disparity)
|
19 |
disparity = disparity / np.max(disparity)
|
20 |
disparity = gray(disparity)[:, :, :3]
|
21 |
+
return disparity
|
22 |
|
23 |
leftCam = gr.inputs.Image(type="numpy")
|
24 |
RightCam = gr.inputs.Image(type="numpy")
|