mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-05 00:05:59 +08:00
enable flake8 E231: missing whitespace after comma
This commit is contained in:
@@ -20,7 +20,7 @@ cam_id = 2
|
||||
if __name__ == "__main__":
|
||||
import cv2 # pylint: disable=import-error
|
||||
|
||||
trans_webcam_to_eon_front = np.dot(eon_dcam_intrinsics,np.linalg.inv(webcam_intrinsics))
|
||||
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)
|
||||
@@ -29,7 +29,7 @@ if __name__ == "__main__":
|
||||
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:,:]
|
||||
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)
|
||||
|
||||
@@ -24,8 +24,8 @@ webcam_intrinsics = np.array([
|
||||
|
||||
if __name__ == "__main__":
|
||||
import cv2 # pylint: disable=import-error
|
||||
trans_webcam_to_eon_rear = np.dot(eon_intrinsics,np.linalg.inv(webcam_intrinsics))
|
||||
trans_webcam_to_eon_front = np.dot(eon_dcam_intrinsics,np.linalg.inv(webcam_intrinsics))
|
||||
trans_webcam_to_eon_rear = np.dot(eon_intrinsics, np.linalg.inv(webcam_intrinsics))
|
||||
trans_webcam_to_eon_front = np.dot(eon_dcam_intrinsics, np.linalg.inv(webcam_intrinsics))
|
||||
print("trans_webcam_to_eon_rear:\n", trans_webcam_to_eon_rear)
|
||||
print("trans_webcam_to_eon_front:\n", trans_webcam_to_eon_front)
|
||||
|
||||
@@ -37,7 +37,7 @@ if __name__ == "__main__":
|
||||
ret, img = cap.read()
|
||||
if ret:
|
||||
# img = cv2.warpPerspective(img, trans_webcam_to_eon_rear, (1164,874), borderMode=cv2.BORDER_CONSTANT, borderValue=0)
|
||||
img = cv2.warpPerspective(img, trans_webcam_to_eon_front, (1164,874), borderMode=cv2.BORDER_CONSTANT, borderValue=0)
|
||||
img = cv2.warpPerspective(img, trans_webcam_to_eon_front, (1164, 874), borderMode=cv2.BORDER_CONSTANT, borderValue=0)
|
||||
print(img.shape, end='\r')
|
||||
cv2.imshow('preview', img)
|
||||
cv2.waitKey(10)
|
||||
|
||||
Reference in New Issue
Block a user