remove depth and fix normal -> vnormal

This commit is contained in:
bluepulsar
2025-12-28 18:52:55 +08:00
parent 6ec9eaa334
commit 4192683271
12 changed files with 54 additions and 60 deletions
+3 -12
View File
@@ -25,19 +25,16 @@ def main():
# 步骤 2.2: 计算形变场
sensor.compute_deformation()
fps, flow,vnormal, depth = sensor.read_info(
fps, flow,vnormal = sensor.read_info(
sensor.info.FPS,
sensor.info.VRAW,
sensor.info.VNORMAL,
sensor.info.DEPTH
sensor.info.VNORMAL
)
# depth = get_depth_improved(vnormal, fps)
# print(f"FPS: {fps:5.1f}, 深度: {np.min(depth):8.2f}, {np.mean(depth):8.2f}, {np.max(depth):8.2f}")
arrows = orisys.util.draw_arrows(
sensor.img.copy(), # 使用 copy() 避免修改原图
@@ -60,17 +57,11 @@ 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=10)
# 在图像上绘制焦点和区域
image_with_foe = orisys.util.draw_foe(sensor.img.copy(), foe_result)
cv2.imshow("Focus of Expansion", image_with_foe)
# 计算多个扩张焦点
# foe_result = orisys.util.compute_multiple_foe(vnormal, min_contour_area=3000,min_magnitude=1,expansion_threshold=0.001,downsample_factor=10)
# # 在图像上绘制多个焦点和区域
# image_with_foe = orisys.util.draw_multiple_foe(sensor.img.copy(), foe_result)
# cv2.imshow("Multiple FOE", image_with_foe)
# =====================================================================
# 4. 键盘控制