gui.py 文件源码

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

项目:spikefuel 作者: duguyue100 项目源码 文件源码
def gen_image_frames(img_path, fps, duration):
    """Generate frames from a image so that can play like a video.

    Parameters
    ----------
    img_path : string
        absolute path to the image.
    fps : int
        frame rates per second
    duration : float
        duration of the sequence in second
    """
    num_frames = int(fps*duration)

    img = cv2.imread(img_path)
    frames = []
    for i in xrange(num_frames):
        frames.append(img)

    return frames, len(frames)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号