update box for robust stitch

This commit is contained in:
TPP-G6
2026-02-07 16:42:04 +08:00
parent f2234f82f0
commit c7d8f8e3fd
2 changed files with 7 additions and 5 deletions
+6 -4
View File
@@ -147,21 +147,23 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument("--video","-v", type=str, default="s1.mp4", help="视频文件路径")
parser.add_argument("--fps", type=float, default=30)
parser.add_argument("--fps", type=float, default=15)
args = parser.parse_args()
fps_video = args.fps
arrow_writer = cv2.VideoWriter(args.video.replace(".mp4", "_arrows.mp4"), cv2.VideoWriter_fourcc(*'mp4v'), fps_video, (384, 384))
pyqt_writer = cv2.VideoWriter(args.video.replace(".mp4", "_pyqt.mp4"), cv2.VideoWriter_fourcc(*'mp4v'), fps_video, (1600, 1200))
depth_writer = cv2.VideoWriter(args.video.replace(".mp4", "_depth.mp4"), cv2.VideoWriter_fourcc(*'mp4v'),fps_video, (384, 384))
sensor1 = orisys.Sensor(args.video, config_name="./config/prototype_of3.json", cal_path= "./config/dd01a_98.npy", isstitch=True, cuda=False, verbose=True)
sensor1 = orisys.Sensor(args.video, config_name="./config/prototype_of3.json", cal_path= args.video.replace(".mp4", ".npy"), isstitch=True, cuda=True, verbose=True)
start_time = time.time()
is_save = False
frame_count = 0
writer = None
while True:
sensor1.get_img() # 提取并拼接复眼图像
img = sensor1.get_img() # 提取并拼接复眼图像
if img is None:
break;
sensor1.compute_deformation() # 计算形变和分解
sensor1.compute_contact()
@@ -177,7 +179,7 @@ def main():
# 显示向量场
# Background color #24292E (BGR)
black_img = np.full_like(sensor1.img, bg_color)
arrows = orisys.util.draw_arrows(black_img, flow, threshold=1, grid_spacing=20, arrow_scale=0.5, colormap=cv2.COLORMAP_PARULA, below_threshold_color=text_color)
arrows = orisys.util.draw_arrows(img, flow, threshold=1, grid_spacing=20, arrow_scale=0.5, colormap=cv2.COLORMAP_PARULA, below_threshold_color=text_color)
cv2.imshow("Deformation", arrows)
# 显示深度图