Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (11 sloc) 483 Bytes
from scannertools import optical_flow, vis, sample_video
import scannerpy
import os
def main():
with sample_video() as video:
db = scannerpy.Database()
flow_fields = optical_flow.compute_flow(db, videos=[video], frames=[[0]])
vis.draw_flows(db, videos=[video], frames=[[0]], flows=flow_fields, paths=['sample_flow.mp4'])
print('Wrote video with flow drawn to {}'.format(os.path.abspath('sample_flow.mp4')))
if __name__ == "__main__":
main()