update box for robust stitch
This commit is contained in:
@@ -18,7 +18,7 @@
|
|||||||
"nominal_ov_pos": 100,
|
"nominal_ov_pos": 100,
|
||||||
"n": [3,3],
|
"n": [3,3],
|
||||||
"row_tol": 0.6,
|
"row_tol": 0.6,
|
||||||
"box_size": [250, 250]
|
"box_size": [220, 220]
|
||||||
},
|
},
|
||||||
"tracker": {
|
"tracker": {
|
||||||
"adaptive": true,
|
"adaptive": true,
|
||||||
|
|||||||
+6
-4
@@ -147,21 +147,23 @@ def main():
|
|||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
parser = argparse.ArgumentParser()
|
||||||
parser.add_argument("--video","-v", type=str, default="s1.mp4", help="视频文件路径")
|
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()
|
args = parser.parse_args()
|
||||||
fps_video = args.fps
|
fps_video = args.fps
|
||||||
arrow_writer = cv2.VideoWriter(args.video.replace(".mp4", "_arrows.mp4"), cv2.VideoWriter_fourcc(*'mp4v'), fps_video, (384, 384))
|
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))
|
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))
|
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()
|
start_time = time.time()
|
||||||
is_save = False
|
is_save = False
|
||||||
frame_count = 0
|
frame_count = 0
|
||||||
writer = None
|
writer = None
|
||||||
while True:
|
while True:
|
||||||
sensor1.get_img() # 提取并拼接复眼图像
|
img = sensor1.get_img() # 提取并拼接复眼图像
|
||||||
|
if img is None:
|
||||||
|
break;
|
||||||
|
|
||||||
sensor1.compute_deformation() # 计算形变和分解
|
sensor1.compute_deformation() # 计算形变和分解
|
||||||
sensor1.compute_contact()
|
sensor1.compute_contact()
|
||||||
@@ -177,7 +179,7 @@ def main():
|
|||||||
# 显示向量场
|
# 显示向量场
|
||||||
# Background color #24292E (BGR)
|
# Background color #24292E (BGR)
|
||||||
black_img = np.full_like(sensor1.img, bg_color)
|
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)
|
cv2.imshow("Deformation", arrows)
|
||||||
|
|
||||||
# 显示深度图
|
# 显示深度图
|
||||||
|
|||||||
Reference in New Issue
Block a user