while running the PyrLK optical flow algorithm of VPI, i found something weird.
the algorithm takes less than 1 milisecond to run, closer even to 0.5 milisecond, but accessing the data using cpu.lock can take 10x times, sometimes even up to 6 miliseconds. i would like some help accessing the data faster if its possible
VPI version : 2.3.9
language : python
code samples:
while True:
1. ret,cvFrame = inVideo.read()
2. frame = vpi.asimage(...) #convert frame to grayscale using backend CUDA
3. curFeatures , status = optflow(frame)
4. with curFeatrues.rlock_cpu():
feature_data = tuple(curFeatures.cpu()[0])
run time :
- 3 milisec
- 0.2 milisec(<200 microsec)
- 0.5 millisec(<500 microsec)
- 2.5-4 millisec
i found no other way to access the data inside the feature array and using lock takes too long, anyone knows a better way of doing it?