optical flow optimize done and cleaned

This commit is contained in:
unknown
2026-01-14 10:13:19 +08:00
parent 4d6bfb49ae
commit 721dccbab4
11 changed files with 120 additions and 108 deletions
+3 -1
View File
@@ -160,11 +160,13 @@ class Sensor:
Returns:
np.ndarray: Processed grayscale image
"""
t0 = time.perf_counter()
ret, frame = self.cap.read()
if not ret:
print("Failed to get_img from video source.")
return None
t1 = time.perf_counter()
print(f"read frame time: {t1 - t0} seconds")
# Convert to grayscale
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)