Giter VIP home page Giter VIP logo

camera-calibration's Introduction

Camera Calibration using Zhang's Method

Build Status

A simple Python library for calibrating camera intrinsics from sensor (2D) and model point (3D) correspondences. Written with few external dependencies (numpy, sympy, imageio) for a more manual implementation and a deeper understanding. OpenCV is imported only for debug and sanity checking implementation. Non-linear optimization is done through minimizing projection error and computing partial derivatives with sympy to populate the Jacobian matrix. Generates synthetic datasets for testing and rudimentary visualization. Can animate the reprojection error each iteration of the calibration. Dockerized for convenience of development, testing, and maybe deployment. Supports radial-tangential (k1, k2, p1, p2, k3) and fisheye (k1, k2, k3, k4) distortion models.

Does not include any feature detection for sensor points. Takes sets of points as inputs, not images.

Prerequisites: make, docker

Getting started

If you'd like to try out the code:

  • Clone the repo and cd into it
  • (Modify code if desired)
  • $ make test

Animated reprojection

This is an example of the reprojection animation of a calibration on a checkerboard, showing all views simultaneously (see animate.py).

  • Green: the measured points
  • Magenta: the reprojection of the model points

reprojection animation

Maybe later:

  • Fix bug in distortion when projecting points outside of field of view

References:

camera-calibration's People

Contributors

pvphan avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

camera-calibration's Issues

How to Calibrate more than 2 cameras?

Hi, I was trying 3D human pose estimation using $3$ cameras: i.e., first finding 2D keypoints from each of the $3$ camera frames and triangulating to get the 3D pose. In such a case, how to get the camera extrinsic parameters? Specifically, for $3$ cameras, should we use $[C1, C2]$, $[C2, C3]$ pairs or should we use $[C1, C2]$, $[C1, C3]$ to find the extrinsic matrix of the cameras?

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.