Giter VIP home page Giter VIP logo

rollingshuttersimulator's Introduction

Summary

This script was inspired by SmarterEveryDay's video on the rolling shutter effect, you should definitely go watch that here: https://youtu.be/dNVtMmLlnoE

This repo provides both a python script and a javascript implementation that runs in your browser at https://jd-13.github.io/rollingShutterSimulator/web/index.html

The script and web interface in this repository will create a simulation of the rolling shutter effect on any video that you provide to it.
When ran they will ask for the video file that you wish to use and several other paramters (described below), and will then generate a simulation of the rolling shutter effect.

alt tag

The script runs interactively (as I imagine this will be more usefull for most), and you can adjust the speed of the effect and the direction of the sweep.

The script produces mp4 files, and can also produce a jpg of the full effect.

(For those interested, the above demo was created from: https://pixabay.com/en/videos/ferris-wheel-fair-night-2122/)

Setup (python)

Before beginning, please note that I have only spent an hour or so working on this so far, so there will be bugs and rough edges.

To run this script you'll need:
python3
opencv (pip install opencv-python)
numpy (pip install numpy)

Running the script (python)

  1. Put the script in the same directory as the video you want to work on. This step isn't really necessary, but it makes things a little easier.
  2. From the directory which contains the script, run: python3.5 rollingShutterSim.py
  3. The script will then ask for a series of parameters. At this time the script does not validate input, so be careful (yeah I definitely need to fix that)
  4. If all goes well you'll get a video or image created in the same directory that you ran the script from

Running the script (web)

Go to https://jd-13.github.io/rollingShutterSimulator/web/index.html

Parameters (python)

Some more information on the parameters which the script will ask for:
File path - The path to the video, or just the name if the video is in the same folder as the script
Frames to increment - Must be an integer, a higher number leads to a faster moving effect
Direction - You must provide one of four options: lr, rl, tb, or bt. This determines the direction of the sweep
Mode - Currently this doesn't work quite right, but this where you choose whether you want video or a single image as output

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.