remove depth and fix normal -> vnormal
This commit is contained in:
+4
-4
@@ -204,11 +204,11 @@ def estimate_depth(foe=None, flow=None, init_depth=None, min_radial_flow=0.01, T
|
||||
|
||||
# 处理FOE附近区域:使用平滑后的值
|
||||
if np.any(mask_foe_region):
|
||||
depth_smoothed = gaussian_filter(depth, sigma=2.0)
|
||||
depth_smoothed = gaussian_filter(depth, sigma=15)
|
||||
depth[mask_foe_region] = depth_smoothed[mask_foe_region]
|
||||
|
||||
# 应用高斯滤波平滑整个深度图,减少噪声和伪影
|
||||
depth = gaussian_filter(depth, sigma=1.5)
|
||||
depth = gaussian_filter(depth, sigma=15)
|
||||
|
||||
# 缩放深度(如果提供了初始深度,只使用掩码内的值)
|
||||
if init_depth is not None:
|
||||
@@ -248,7 +248,7 @@ def estimate_depth(foe=None, flow=None, init_depth=None, min_radial_flow=0.01, T
|
||||
depth = np.clip(depth, p1, p99)
|
||||
|
||||
# 最终平滑:对FOE附近区域再次应用平滑,确保伪影被消除
|
||||
depth_final_smooth = gaussian_filter(depth, sigma=1.0)
|
||||
depth_final_smooth = gaussian_filter(depth, sigma=15)
|
||||
|
||||
# 重新计算FOE附近掩码
|
||||
rx = xx - fx
|
||||
@@ -321,7 +321,7 @@ def main():
|
||||
|
||||
# 计算扩张焦点
|
||||
# foe_result = orisys.util.compute_foe(vnormal,min_magnitude=1,expansion_threshold=0.01,downsample_factor=1)
|
||||
foe_result = sensor.get_foe(multiple_foe=False, min_magnitude=1, expansion_threshold=0.01, downsample_factor=1)
|
||||
foe_result = sensor.get_foe(multiple_foe=False, min_magnitude=1, expansion_threshold=0.01, downsample_factor=1,denoise_sigma=15)
|
||||
# 在图像上绘制焦点和区域
|
||||
image_with_foe = orisys.util.draw_foe(sensor.img.copy(), foe_result)
|
||||
cv2.imshow("Focus of Expansion", image_with_foe)
|
||||
|
||||
Reference in New Issue
Block a user