JohnChiu commited on
Commit
82e6cc4
·
1 Parent(s): 760b53b

Add application file

Browse files
Files changed (1) hide show
  1. app.py +3 -1
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 - arr.min()) / (np.ptp(arr) + 1e-8)
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)