optical flow optimize done and cleaned
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user