Code Monkey home page Code Monkey logo

erfanfathi / camera-calibration Goto Github PK

View Code? Open in Web Editor NEW
26.0 4.0 7.0 452 KB

This repository include implementation of calibrating intrinsic and extrinsic camera parameter for distance calculation

License: MIT License

CMake 2.29% C++ 97.71%
camera-calibration cpp cmake quaternion quaternion-camera camera-geometry chessboard-detection rotation-matrix particle-swarm-optimization computer-vision intrinsic-parameters extrinsic-parameters calibration opencv distance-calculation pso-algorithm opencv-cpp robotics robot-vision

camera-calibration's Introduction

Camera Calibration

Implementation of calibrating intrinsic and extrinsic camera parameter with pso optimization and quaternion rotation for distance calculation .

Dependencies

sudo apt install libopencv-dev cmake

Environment Setup

First, set the camera in a fixed position then place the chessboard in front of it at a fixed distance, as shown below :

Compilation

cmake .
make all
./Calibration

Code Setup

In "main.cpp" file i write some comments which that helps you ...

1) Input Real Points :

generally you should first set the actual distance in "realPoint" array in main.cpp file just note that the array is as follows :

2) Set Optimization Parameter :

This part of process very important because pso algorithm highly parameter based so pay attention to the parameters.

How To Use ?

After the setup environment and code, compile and run code . if print "pattern not found" there is a problem in your chessboard check that if print "pattern found" that's ok . after calibration process you have 10 parameter . now you can use that and calculate distance or pixel . for this work there is two function :

F1) Field2Image

Field2Image function get distance "milimeter" and calculate pixel .

F2) Image2Field

vice versa :)

Detected Corners

Projected Corners After Calibration

Euler angles and quaternions

If you want read more about euler angles and quaternions i suggest you read the following paper :
A Tutorial on Euler Angles and Quaternions

License

This project is licensed under the MIT License - see the LICENSE file for details

Finale

Report any comment or bugs or question to:
[email protected]

camera-calibration's People

Contributors

erfanfathi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  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.