Add application file
Browse files
app.py
CHANGED
|
@@ -68,7 +68,7 @@ def plot_pixel_histogram(evt: gr.SelectData, raw_hist, nor_hist):
|
|
| 68 |
return fig
|
| 69 |
|
| 70 |
def to_uint8_image(arr):
|
| 71 |
-
norm = (arr
|
| 72 |
return (norm * 255).astype(np.uint8)
|
| 73 |
|
| 74 |
def plot_depth(nor_hist):
|
|
@@ -97,6 +97,8 @@ def plot_depth(nor_hist):
|
|
| 97 |
tof_filter = np.argmax(arr_expandfilter, axis=2)
|
| 98 |
|
| 99 |
ref = np.max(arr, axis=2)
|
|
|
|
|
|
|
| 100 |
mask = ref>3
|
| 101 |
# 转uint8图像方便展示
|
| 102 |
img_tof = to_uint8_image(tof)
|
|
|
|
| 68 |
return fig
|
| 69 |
|
| 70 |
def to_uint8_image(arr):
|
| 71 |
+
norm = (arr) / (np.max(arr) + 1e-8)
|
| 72 |
return (norm * 255).astype(np.uint8)
|
| 73 |
|
| 74 |
def plot_depth(nor_hist):
|
|
|
|
| 97 |
tof_filter = np.argmax(arr_expandfilter, axis=2)
|
| 98 |
|
| 99 |
ref = np.max(arr, axis=2)
|
| 100 |
+
ref_filter = np.max(arr_expandfilter, axis=2)
|
| 101 |
+
|
| 102 |
mask = ref>3
|
| 103 |
# 转uint8图像方便展示
|
| 104 |
img_tof = to_uint8_image(tof)
|