Giter Site home page Giter Site logo

shshsh2016 / hudldistortioncorrectiontool Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hudl/hudldistortioncorrectiontool

1.0 0.0 0.0 1.32 MB

Toolbox for generating, tweaking, and applying distortion correction parameters to videos and images

License: Apache License 2.0

C++ 99.22% CMake 0.78%

hudldistortioncorrectiontool's Introduction

Distortion Correction tool

This is a tool for generating, tweaking and applying lens distortion correction parameters on videos captured with wide angle/ fisheye lenses.

This tool is based on the OpenCV library https://github.com/opencv/opencv and the CVUI lib https://github.com/Dovyski/cvui

Mode 1: Generate camera parameters:

To generate the camera paramaters (camera instrinsic matrix and lens destortion coefficents), take (10 to 30) photos of the calibration pattern in different poses. http://docs.opencv.org/2.4/_downloads/pattern.png

Usage : ./DistortionCorrection imges_dir

Example : /DistortionCorrection "data/patternImages/"

Parameters

images_dir directory of calibration pattern images.

Outputs

CamaraParams.yaml Computed camera Parameters.

Mode 2: Tweak camera parameters:

This mode will launch an intaractive GUI that will allow you to tweak the camera parameters in the initial .yaml file from Mode 1 for more visually appealing results. Once you are done with tweaking, press the space, escape or enter key to save the outputs.

Usage : ./DistortionCorrection one_image InCameraParams.yaml DisplayScaleFactor

Example 1 : /DistortionCorrection "ExampleData/image.jpg" "data/DistCoeffs.yaml" 2.5

Example 2 : /DistortionCorrection "ExampleData/image.jpg" "data/DistCoeffs.yaml"

Parameters:

InCamaraParams.yaml- input camera Parameters.

one_image - a single frame of the video to be corrected.

DisplayScaleFactor - optional - display scale factor (use when frame size is too large to fit in screen).

Outputs:

CamaraParams.yaml - Tweaked camera Parameters.

CorrectedImage.jpg - Distortion Corrected image.

Mode 3: Apply parameters to a video:

This script takes an input video and output directory and a .yaml file, and produces distortion-corrected images.

Usage : ./DistortionCorrection CamaraParams.yaml inputVid Output

Example 1: ./DistortionCorrection "CamaraParams.yaml" "data/in_video.mp4" "data/out_video.mp4"

Example 2: ./DistortionCorrection "CamaraParams.yaml" "data/in_video.mp4" "data/out_images/*.jpg"

Parametres:

CamaraParams.yaml - camera Parameters file (generted by mode 1 or 2).

inputVid - Input video to be undistorted.

Output - If this is an .mp4 file, it'll write a video stream. If it uses a pattern like directory/*.png or directory/*.jpg, it'll write a series of images.

tool

hudldistortioncorrectiontool's People

Contributors

abuzaina avatar casey-bateman avatar

Stargazers

 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.