def review(self, TD_object):
"""Displays the TD recording overlaid with the annotated track.
On events are red, and off events are blue.
Takes in:
TD_object: An Events object (see eventvision module).
"""
cv2.namedWindow('review_frame')
for i in range(1, len(self.data.ts)):
current_frame = np.zeros((TD_object.height,TD_object.width,3), np.uint8)
tmin = self.data.ts[i-1]
tmax = self.data.ts[i]
tminind = np.min(np.where(TD_object.data.ts >= tmin))
tmaxind = np.max(np.where(TD_object.data.ts <= tmax))
# Populate the current frame with all the events which occur between successive timestamps of the
# annotated track events. Track event which was saved at the end of the current frame is shown.
current_frame[TD_object.data.y[tminind:tmaxind][TD_object.data.p[tminind:tmaxind] == 1], TD_object.data.x[tminind:tmaxind][TD_object.data.p[tminind:tmaxind] == 1], :] = [100, 100, 255]
current_frame[TD_object.data.y[tminind:tmaxind][TD_object.data.p[tminind:tmaxind] == 0], TD_object.data.x[tminind:tmaxind][TD_object.data.p[tminind:tmaxind] == 0], :] = [255, 255, 30]
cv2.circle(current_frame, (self.data.x[i], self.data.y[i]), 10, (0,255,0), 2)
cv2.imshow('review_frame', current_frame)
key = cv2.waitKey(1)
cv2.destroyWindow('review_frame')
评论列表
文章目录