update raft optical flow

This commit is contained in:
bluepulsar
2026-01-31 15:22:19 +08:00
parent 2ebbe1a284
commit 58c3d97fab
7 changed files with 117 additions and 141 deletions
+3 -3
View File
@@ -164,7 +164,7 @@ class Sensor:
if not ret:
print("Failed to get_img from video source.")
return None
self.frame = frame
self.frame = frame.copy()
# Convert to grayscale
# gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
gray = frame
@@ -215,8 +215,8 @@ class Sensor:
if self.img is None:
raise Exception("Warning: Get image first")
# flow = self.__tracker.track(self.img)
flow = self.__tracker.track_raft(self.img)
flow = self.__tracker.track(self.img)
# flow = self.__tracker.track_raft(self.img)
if hasattr(flow, 'download'):
flow = flow.download()
self.flow = flow