GithubHelp home page GithubHelp logo

vincent51689453 / cameracalibration Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dakotabenjamin/cameracalibration

0.0 0.0 0.0 107.94 MB

License: GNU General Public License v3.0

Python 96.93% Dockerfile 3.07%

cameracalibration's Introduction

CameraCalibration

This suite of scripts will find camera matrix and distortion parameters with a set of checkerboard images, then use thos parameters to remove distortion from photos.

Installation

You need to install numpy and opencv:

pip install numpy
sudo apt-get install python-opencv exiftool

Usage: Calibrate chessboard

First you will need to take some photos of a black and white chessboard with a white border, like this one.

Then you will run the opencv_calibrate.py script to generate the matrix and distortion files.

python opencv_calibrate.py ./sample/chessboard/ 10 7

The first argument is the path to the chessboard. You will also have to input the chessboard dimensions (the number of squares in x and y) Optional arguments:

--out           path      if you want to output the parameters and the image outputs to a specific path. otherwise it gets writting to ./out
--square_size   float     if your chessboard squares are not square, you can change this. default is 1.0

Usage: undistort photos

With the photos and the produced matrix.txt and distortion.txt, run the following:

python undistort.py --matrix matrix.txt --distortion distortion.txt "/path/to/images/"

Note: Do not forget the quotes in "/path/to/images"

Docker Usage for undistorting images

This assumes you already have the distortion and matrix parameters. Put the matri.txt and distortion.txt in their own directory (eg. sample/config) and do the following:

Build:

docker build -t cc_undistort .

Run: (using sample images in this example)

docker run -v ~/CameraCalibration/sample/images:/app/images \
           -v ~/CameraCalibration/sample/config:/app/config \
           cc_undistort

cameracalibration's People

Contributors

dakotabenjamin avatar mojodna avatar vincent51689453 avatar pierotofy 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.