optical_flow_double.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:vizgen 作者: uva-graphics 项目源码 文件源码
def main():
    if Display:
        cap = cv2.VideoCapture(0)
        out = cv2.VideoWriter('output.avi', -1, 2.0, (600, 440))
        count = 0

        while(count < 20):
            ret, frame1 = cap.read()
            ret, frame2 = cap.read()

            frame1 = skimage.img_as_float(frame1)
            frame2 = skimage.img_as_float(frame2)

            output_img = optical_flow_ssd(frame1, frame2)
            out.write(output_img)

            cv2.imshow('frame', output_img)
            count = count + 1

            if cv2.waitKey(1) & 0xFF == ord('q'):
                cap.release()
                out.release()
                cv2.destroyAllWindows()
                break
    else:
        test()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号