Skip to content

Latest commit

 

History

History
109 lines (74 loc) · 3.22 KB

readme.md

File metadata and controls

109 lines (74 loc) · 3.22 KB

#Main version: ##Source Tree:

Acknowledgements

The origin author, Lionel Heng.

Support Camera Models:

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:

Calibration:

Use intrinsic_calib.cc to calibrate your camera. The template is like fisheye_calibration.sh:

./Calibration --camera-name mycamera --input mycameara_images/ -p IMG -e png -w 11 -h 8 --size 70 --camera-model myfisheye --opencv true

USE:

Two main files for you to use camera model: Camera.h and CameraFactory.h. ##1.load in the camera model calibration file Use function in CameraFactory.h to load in the camra calibration file:

#include <camera_model/camera_models/CameraFactory.h>

camera_model::CameraPtr cam;

void loadCameraFile(std::string camera_model_file)
{
    cam = camera_model::CameraFactory::instance()->generateCameraFromYamlFile(camera_model_file);
}

##2.projection and back-projection point See Camera.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;

void loadCameraFile(std::string camera_model_file)
{
    cam = camera_model::CameraFactory::instance()->generateCameraFromYamlFile(camera_model_file);
}

void useProjection(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;

void loadCameraFile(std::string camera_model_file)
{
    cam = camera_model::CameraFactory::instance()->generateCameraFromYamlFile(camera_model_file);
}

void useProjection(Eigen::Vector3d P)
{
    Eigen::Vector2d p_dst;
    cam->spaceToPlane(P, p_dst);
}

void useBackProjection(Eigen::Vector2d p)
{
    Eigen::Vector3d P_dst;
    cam->liftSphere(p, P_dst);
}