Giter VIP home page Giter VIP logo

lens_undistort's Introduction

This software finds the undistorsion parameters for your camera lens. I used it with some gopros, where the usual checkerboard based opencv calibration didn't work well. If you have the same problem this might be the solution for you.

General description:

  1. Get a planar light coloured plain surface. Draw, print, paint, or tape dark straight stripes on it.
  2. Record a video, or make still frames with your camera. The framing should be so that the surface fills the whole picture. (see examples) So the stripes leave the picture at the borders. Move the camera around, also rotate it around the optical axis. Record the stripes in both horizontal, vertical, and various cross positions. Make sure that you have pictures where the lines are around the middle of the frame, to one of the sides, and also where they cross through a corner. Now we know that all of those contours should be straight, but they are not because our camera distorted them. Move the
  3. Use the software on these inputs. It will run a non-linear optimalization to find the parameters which transform the curved contours into lines.
  4. The software will write these parameters into a file. It will also generate a hdf5 file with the undistortion mapping, which you can use with cv::remap to undistort in your software, whenever you need to.

Take a look at the example pictures. The real problem with the "bad.png" is not that it's dark, tough it is, but that the pattern was too small, and you can see the harsh reality intrude in the bottom-left corner.

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.