Compile FrogPilot

This commit is contained in:
FrogAi
2024-03-10 20:59:55 -07:00
parent 69e7feaf01
commit f1acd339d7
1485 changed files with 426154 additions and 398339 deletions

View File

@@ -1,35 +0,0 @@
#!/usr/bin/env python
import numpy as np
# copied from openpilot.common.transformations/camera.py
eon_dcam_focal_length = 860.0 # pixels
webcam_focal_length = 908.0 # pixels
eon_dcam_intrinsics = np.array([
[eon_dcam_focal_length, 0, 1152/2.],
[ 0, eon_dcam_focal_length, 864/2.],
[ 0, 0, 1]])
webcam_intrinsics = np.array([
[webcam_focal_length, 0., 1280/2.],
[ 0., webcam_focal_length, 720/2.],
[ 0., 0., 1.]])
cam_id = 2
if __name__ == "__main__":
import cv2
trans_webcam_to_eon_front = np.dot(eon_dcam_intrinsics, np.linalg.inv(webcam_intrinsics))
cap = cv2.VideoCapture(cam_id)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 1280)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 720)
while (True):
ret, img = cap.read()
if ret:
img = cv2.warpPerspective(img, trans_webcam_to_eon_front, (1152, 864), borderMode=cv2.BORDER_CONSTANT, borderValue=0)
img = img[:, -864//2:, :]
cv2.imshow('preview', img)
cv2.waitKey(10)