Hi erik
I tried to convert collision avoidance program to work with video
Following is section of code where I need some help
def run(self):
try:
log.info("Setup complete, parsing frames...")
for frame, results in self.depthai.capture():
self.parse_frame(frame, results)
finally:
del self.depthai
How do I pass video frame for this? this doesn't seem to be typical camera/video read method
For example, I can read video using following method.
cap = cv2.VideoCapture('demosd.mp4')
Not sure how to pass this to above function...I created a function do so as below:
def run_video(self):
cap = cv2.VideoCapture('demosd.mp4')
while cap.isOpened():
results, self.frame = cap.read()
if not results:
break
try:
self.parse_frame(self.frame, results)
except StopIteration:
break
cap.release()
I get following error, this is from following method
method:
def parse_frame(self, frame, results):
pts = [(item.depth_x, item.depth_z) for item in results]
tracker_objs = self.tracker.update(pts)
error:
pts = [(item.depth_x, item.depth_z) for item in results]
TypeError: 'bool' object is not iterable
Need some help here as it appears the method: "depthai.capture()" defaults to camera and I do not see any code to open camera and read frames where I could possibly replace with frames read from video file...
How do we pass video frame to above method?
Thanks in advance for your time and help...
Thanks & Best Regards,
Ram