mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-09-30 19:33:49 +08:00
generalize camera assumptions (#2423)
* clean up 1 * complain * cleanup * make models api generic * clean up 2 * cleanup * remove unused
This commit is contained in:
@@ -6,6 +6,8 @@ import matplotlib.pyplot as plt
|
||||
import numpy as np
|
||||
import pygame # pylint: disable=import-error
|
||||
|
||||
from common.transformations.camera import (eon_f_frame_size, eon_f_focal_length,
|
||||
tici_f_frame_size, tici_f_focal_length)
|
||||
from selfdrive.config import RADAR_TO_CAMERA
|
||||
from selfdrive.config import UIParams as UP
|
||||
from selfdrive.controls.lib.lane_planner import (compute_path_pinv,
|
||||
@@ -29,7 +31,9 @@ _FULL_FRAME_SIZE = {
|
||||
_BB_TO_FULL_FRAME = {}
|
||||
_FULL_FRAME_TO_BB = {}
|
||||
_INTRINSICS = {}
|
||||
for width, height, focal in [(1164, 874, 910), (1928, 1208, 2648)]:
|
||||
cams = [(eon_f_frame_size[0], eon_f_frame_size[1], eon_f_focal_length),
|
||||
(tici_f_frame_size[0], tici_f_frame_size[1], tici_f_focal_length)]
|
||||
for width, height, focal in cams:
|
||||
sz = width * height
|
||||
_BB_SCALE = width / 640.
|
||||
_BB_TO_FULL_FRAME[sz] = np.asarray([
|
||||
|
||||
+1
-1
@@ -196,7 +196,7 @@ def ui_thread(addr, frame_address):
|
||||
if sm.updated['liveCalibration'] and num_px:
|
||||
extrinsic_matrix = np.asarray(sm['liveCalibration'].extrinsicMatrix).reshape(3, 4)
|
||||
ke = intrinsic_matrix.dot(extrinsic_matrix)
|
||||
warp_matrix = get_camera_frame_from_model_frame(ke)
|
||||
warp_matrix = get_camera_frame_from_model_frame(ke, camera_fl=intrinsic_matrix[0][0])
|
||||
calibration = CalibrationTransformsForWarpMatrix(num_px, warp_matrix, intrinsic_matrix, extrinsic_matrix)
|
||||
|
||||
# draw red pt for lead car in the main img
|
||||
|
||||
Reference in New Issue
Block a user