Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- flow = cv2.calcOpticalFlowFarneback(prvs,frame_next, None, 0.5, 3, 15, 3, 5, 1.2, 0)
- k = cv2.waitKey(1) & 0xff
- if k == 27:
- break
- elif k == ord('s'):
- cv2.imwrite('opticalfb.png',frame2)
- cv2.imwrite('opticalhsv.png',rgb)
- prvs = frame_next
- for i in range(len(output_image)):
- for j in range(len(output_image[0])):
- if prvs[i][j] != 0:
- output_image[i][j] = [0, 255, 0]
- output_image = cv2.arrowedLine(output_image, (j ,i), (j + int(flow[i][j][0]), i + int(flow[i][j][1])), (0, 0, 255), 1)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement