piwall.py 文件源码

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

项目:piwall-cvtools 作者: infinnovation 项目源码 文件源码
def __init__(self, video_src = 0, 
                 interactive = True, 
                 video = 'chess.avi', fallback = 'synth:bg=./data/hi.jpg:noise=0.05', nFrames = 500):
        cam = create_capture(video_src, fallback=fallback)
        if not cam:
            print("Problem initialising cam")

        vwriter = VideoWriter(video)
        run = True
        t = clock()
        frameCounter = nFrames
        while frameCounter>0:
            ret, img = cam.read()
            vwriter.addFrame(img, width=1920)
            frameCounter-=1
            print("%d" % frameCounter)
        print("Created chessboard video : saved %d frames to %s" % (nFrames, video))
        vwriter.finalise()


#####################################################################################################################
# Tutorials
#####################################################################################################################

# Placeholder for snippets used in development taken from the tutorials.
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号