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