event_iterator.reader.reset() # Reset the reader
event_iterator.start_ts = int(1e6)
event_iterator.delta_t = int(1e6)
imgp = np.zeros((height, width), dtype=np.uint8) # Create an empty image
imgn = np.zeros((height, width), dtype=np.uint8) # Create an empty image
for evts in event_iterator:
imgp[evts['y'][evts['p'] == 1], evts['x'][evts['p'] == 1]] = 255
imgn[evts['y'][evts['p'] == 0], evts['x'][evts['p'] == 0]] = 255
break # Only do one iteration
return imgp, imgn