环视运行

This commit is contained in:
2025-12-19 17:08:28 +08:00
parent 5283a6f54a
commit 86df465b15
47 changed files with 485 additions and 102 deletions

View File

@@ -92,7 +92,7 @@ class FisheyeCameraModel(object):
return cv2.transpose(image)[::-1]
else:
return cv2.transpose(image)[::-1]
return cv2.transpose(image)[:,::-1]
def save_data(self):
fs = cv2.FileStorage(self.camera_file, cv2.FILE_STORAGE_WRITE)

View File

@@ -6,22 +6,24 @@ camera_names = ["front", "back", "left", "right"]
# --------------------------------------------------------------------
# (shift_width, shift_height): 鸟瞰图在水平和垂直方向上超出标定图案的距离
shift_w = 300
shift_h = 300
shift_w = 100
shift_h = 100
# 标定图案与车辆之间在水平和垂直方向上的间隙大小
inn_shift_w = 20
inn_shift_h = 50
inn_shift_h = 20
# 拼接图像的总宽度/高度
total_w = 600 + 2 * shift_w
total_h = 1000 + 2 * shift_h
total_w = 300 + 2 * shift_w
total_h = 350 + 2 * shift_h
# 车辆所占矩形区域的四个角点
# 左上角 (x_left, y_top),右下角 (x_right, y_bottom)
xl = shift_w + 180 + inn_shift_w
# 计算车辆在全景图中的位置
xl = shift_w + 45 + inn_shift_w
xr = total_w - xl
yt = shift_h + 200 + inn_shift_h
print(xl, xr)
yt = shift_h + 60 + inn_shift_h
yb = total_h - yt
# --------------------------------------------------------------------
@@ -32,29 +34,28 @@ project_shapes = {
"right": (total_h, xl)
}
# pixel locations of the four points to be chosen.
# you must click these pixels in the same order when running
# the get_projection_map.py script
# 要选取的四个像素点的位置。
# 运行 get_projection_map.py 脚本时,必须按相同顺序点击这些像素点。
project_keypoints = {
"front": [(shift_w + 120, shift_h),
(shift_w + 480, shift_h),
(shift_w + 120, shift_h + 160),
(shift_w + 480, shift_h + 160)],
"front": [(shift_w + 0, shift_h),
(shift_w + 300, shift_h),
(shift_w + 0, shift_h + 60),
(shift_w + 300, shift_h + 60)],
"back": [(shift_w + 120, shift_h),
(shift_w + 480, shift_h),
(shift_w + 120, shift_h + 160),
(shift_w + 480, shift_h + 160)],
"back": [(shift_w + 0, shift_h),
(shift_w + 300, shift_h),
(shift_w + 0, shift_h + 80),
(shift_w + 300, shift_h + 80)],
"left": [(shift_h + 280, shift_w),
(shift_h + 840, shift_w),
(shift_h + 280, shift_w + 160),
(shift_h + 840, shift_w + 160)],
"left": [(shift_h + 0, shift_w),
(shift_h + 350, shift_w),
(shift_h + 0, shift_w + 50),
(shift_h + 350, shift_w + 50)],
"right": [(shift_h + 160, shift_w),
(shift_h + 720, shift_w),
(shift_h + 160, shift_w + 160),
(shift_h + 720, shift_w + 160)]
"right": [(shift_h + 0, shift_w),
(shift_h + 350, shift_w),
(shift_h + 0, shift_w + 50),
(shift_h + 350, shift_w + 50)]
}
car_image = cv2.imread(os.path.join(os.getcwd(), "images", "car.png"))