def update(self, frame): # update the tracker with the current frame pyMTF.update(frame.astype(np.uint8), self.tracker_corners) return True, self.tracker_corners.T.copy()
2:4].tolist(), ground_truth[frame_id, 4:6].tolist(), ground_truth[frame_id, 6:8].tolist() ] actual_corners = np.array(actual_corners).T if not use_rgb_input: src_img_disp = src_img.copy() src_img = cv2.cvtColor(src_img, cv2.COLOR_RGB2GRAY) else: src_img_disp = src_img start_time = time.clock() # update the tracker with the current frame pyMTF.update(src_img.astype(np.uint8), tracker_corners) if not isinstance(tracker_corners, np.ndarray): print 'Tracker update was unsuccessful' sys.exit() # print('tracker_corners before:\n {}'.format(tracker_corners)) # pyMTF.setRegion(tracker_corners) # print('tracker_corners after:\n {}\n\n'.format(tracker_corners)) end_time = time.clock() # compute the tracking fps current_fps = 1.0 / (end_time - start_time) tracking_fps.append(current_fps)
def update(self, img): self.proposal = pyMTF.update(img.astype(np.uint8))