- Notifications
You must be signed in to change notification settings - Fork34
gaowenliang/camera_model
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
#Main version:##Source Tree:
- Refine fromCamOdoCal
- Refined by YZFdvorak0
- Modified by LIU TiamboGroundMelon
- Modified by GWLgaowenliang
The origin author, Lionel Heng.
Pinhole Camera
Cata Camera
Equidistant Camera
Scaramuzza Camera Model
Polynomial Fisheye Camera
This is my camera model
Fov Camera
#Install
To use this package, need:
- Eigen3
- ROS, almost use indigo version.
- Ceres Solver
Useintrinsic_calib.cc to calibrate your camera.The template is likefisheye_calibration.sh:
./Calibration --camera-name mycamera --input mycameara_images/ -p IMG -e png -w 11 -h 8 --size 70 --camera-model myfisheye --opencv true
Two main files for you to use camera model:Camera.h andCameraFactory.h.##1.load in the camera model calibration fileUse function inCameraFactory.h to load in the camra calibration file:
#include<camera_model/camera_models/CameraFactory.h>camera_model::CameraPtr cam;voidloadCameraFile(std::string camera_model_file){ cam =camera_model::CameraFactory::instance()->generateCameraFromYamlFile(camera_model_file);}
##2.projection and back-projection pointSeeCamera.h for general interface:
Projection (3D ---> 2D) function:spaceToPlane :Projects 3D points to the image plane (Pi function)
#include<camera_model/camera_models/CameraFactory.h>camera_model::CameraPtr cam;voidloadCameraFile(std::string camera_model_file){ cam =camera_model::CameraFactory::instance()->generateCameraFromYamlFile(camera_model_file);}voiduseProjection(Eigen::Vector3d P){ Eigen::Vector2d p_dst; cam->spaceToPlane(P, p_dst);}
Back Projection (2D ---> 3D) function:liftSphere: Lift points from the image plane to the projective space.
#include<camera_model/camera_models/CameraFactory.h>camera_model::CameraPtr cam;voidloadCameraFile(std::string camera_model_file){ cam =camera_model::CameraFactory::instance()->generateCameraFromYamlFile(camera_model_file);}voiduseProjection(Eigen::Vector3d P){ Eigen::Vector2d p_dst; cam->spaceToPlane(P, p_dst);}voiduseBackProjection(Eigen::Vector2d p){ Eigen::Vector3d P_dst; cam->liftSphere(p, P_dst);}