Giter Club home page Giter Club logo

imvideo_dev's Introduction

PyPI version Downloads Downloads

Imvideo

Imvideo helps you create time-lapse videos from camera-generated image folder and your matplotlib loop.

Install Imvideo


To install this package, type pip install imvideo in command prompt.

C:\Users\user>pip install imvideo
Collecting imvideo
  Using cached imvideo-0.0.1-py3-none-any.whl (3.6 kB)
Installing collected packages: imvideo
Successfully installed imvideo-0.0.1

Function Details


Class local: timelapse(title, fps, folder_path, inspect=True):

timelapse(title, fps, folder_path, inspect=True):
Function constructs time-lapse video from images in a folder.
        Inputs:     title   (string)     video title + .avi
                    fps     (double)     time-lapse video frames per second 
                    folder_path    (raw string)    location of the image folder
                    inspect    (boolean)       True (default)/False
        Output:
                    time-lapse video

Class memory: savebuff(frame, container):

savebuff(frame, container):
Function saves image in in-memory location
         Inputs:    frame   (matplotlib image)  
                    container   (list)     empty image container
         Output:    container   (list)      image container with added frame location

construct(container, title, fps, inspect=True):

construct(container, title, fps, inspect=True):
Function constructs video from images in the container.
         Inputs:    container   (list)      image container with frame location
                    title   (string)     video title + .avi
                    fps     (double)     time-lapse video frames per second 
                    inspect    (boolean)       True (default)/False
         Output:
                    video

Use Imvideo


  1. Time-lapse video from a image folder:
import imvideo as imv

imv.local.timelapse('demo.avi', 5,  r".\tests\test_image"))
  1. Time-lapse video from a matplotlib loop:
import imvideo as imv

def test_matplot_loop(n):
    ''' Input:      n   number of frames'''
    images = []     # empty image container
    plt.figure()    
    for i in range(n):
        plt.plot([np.random.randint(2), np.random.randint(2)])
        plt.title("test" + str(i))
        images = imv.memory.savebuff(plt, images)      # save image in in-memory location
        plt.close()
    
    imv.memory.construct(images, 'matplot_demo.avi', 5)        # construct video; 5 fps

    return 

test_matplot_loop(100)      # construct a demo video with 100 frames

Sample output

Solve Laplace

imvideo_dev's People

Contributors

xli2522 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.