Implementation of calibrating intrinsic and extrinsic camera parameter with pso optimization and quaternion rotation for distance calculation .
sudo apt install libopencv-dev cmake
First, set the camera in a fixed position then place the chessboard in front of it at a fixed distance, as shown below :
cmake .
make all
./Calibration
generally you should first set the actual distance in "realPoint" array in main.cpp file just note that the array is as follows :
This part of process very important because pso algorithm
highly parameter based so pay attention to the parameters.
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 :
Field2Image function get distance "milimeter" and calculate pixel .
vice versa :)
If you want read more about euler angles and quaternions i suggest you read the following paper :
A Tutorial on Euler Angles and Quaternions
This project is licensed under the MIT License - see the LICENSE file for details
Report any comment or bugs or question to:
[email protected]