Home | History | Annotate | Download | only in python2

Lines Matching refs:flow

11  1 - toggle HSV flow visualization
16 def draw_flow(img, flow, step=16):
19 fx, fy = flow[y,x].T
28 def draw_hsv(flow):
29 h, w = flow.shape[:2]
30 fx, fy = flow[:,:,0], flow[:,:,1]
40 def warp_flow(img, flow):
41 h, w = flow.shape[:2]
42 flow = -flow
43 flow[:,:,0] += np.arange(w)
44 flow[:,:,1] += np.arange(h)[:,np.newaxis]
45 res = cv2.remap(img, flow, None, cv2.INTER_LINEAR)
66 flow = cv2.calcOpticalFlowFarneback(prevgray, gray, None, 0.5, 3, 15, 3, 5, 1.2, 0)
69 cv2.imshow('flow', draw_flow(gray, flow))
71 cv2.imshow('flow HSV', draw_hsv(flow))
73 cur_glitch = warp_flow(cur_glitch, flow)
81 print 'HSV flow visualization is', ['off', 'on'][show_hsv]