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
-6
View File
@@ -1,8 +1,5 @@
import cv2
import numpy as np
import cupy as cp
import time
class Tracker:
def __init__(self,
@@ -146,12 +143,9 @@ class Tracker:
self.__checkLoopClosure(frame)
# CPU optical flow computation
start_time = time.perf_counter()
self.__prev_fine_flow = self.__tracking_inst.calc(
self.__fine_base_frame_queue[-1], frame,
self.__prev_fine_flow)
end_time = time.perf_counter()
print(f"CPU optical flow computation time: {end_time - start_time} seconds")
# Direct numpy addition is faster than cv2.add
final_flow = self.__fine_flow_queue[-1] + self.__prev_fine_flow