Function bodies 2,155 total
ViewerConfig class · c · L30-L34 (5 LOC)include/Config.h
class ViewerConfig
{
};CameraConfig class · c · L35-L39 (5 LOC)include/Config.h
class CameraConfig
{
};ORBExtractorConfig class · c · L40-L44 (5 LOC)include/Config.h
class ORBExtractorConfig
{
};IMUConfig class · c · L45-L49 (5 LOC)include/Config.h
class IMUConfig
{
};ConfigParser class · c · L50-L63 (14 LOC)include/Config.h
class ConfigParser
{
public:
bool ParseConfigFile(std::string &strConfigFile);
private:
ViewerConfig mViewerConfig;
CameraConfig mCameraConfig;
ORBExtractorConfig mORBConfig;
IMUConfig mIMUConfig;
};Converter class · c · L34-L77 (44 LOC)include/Converter.h
class Converter
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
static std::vector<cv::Mat> toDescriptorVector(const cv::Mat &Descriptors);
static g2o::SE3Quat toSE3Quat(const cv::Mat &cvT);
static g2o::SE3Quat toSE3Quat(const Sophus::SE3f &T);
static g2o::SE3Quat toSE3Quat(const g2o::Sim3 &gSim3);
// TODO templetize these functions
static cv::Mat toCvMat(const g2o::SE3Quat &SE3);
static cv::Mat toCvMat(const g2o::Sim3 &Sim3);
static cv::Mat toCvMat(const Eigen::Matrix<double,4,4> &m);
static cv::Mat toCvMat(const Eigen::Matrix<float,4,4> &m);
static cv::Mat toCvMat(const Eigen::Matrix<float,3,4> &m);
static cv::Mat toCvMat(const Eigen::Matrix3d &m);
static cv::Mat toCvMat(const Eigen::Matrix<double,3,1> &m);
static cv::Mat toCvMat(const Eigen::Matrix<float,3,1> &m);
static cv::Mat toCvMat(const Eigen::Matrix<float,3,3> &m);
static cv::Mat toCvMat(const Eigen::MatrixXf &m);
static cv::Mat toCvMat(const Eigen::MatrixXd &mFrameDrawer class · c · L39-L87 (49 LOC)include/FrameDrawer.h
class FrameDrawer
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
FrameDrawer(Atlas* pAtlas);
// Update info from the last processed frame.
void Update(Tracking *pTracker);
// Draw last processed frame.
cv::Mat DrawFrame(float imageScale=1.f);
cv::Mat DrawRightFrame(float imageScale=1.f);
bool both;
protected:
void DrawTextInfo(cv::Mat &im, int nState, cv::Mat &imText);
// Info of the frame to be drawn
cv::Mat mIm, mImRight;
int N;
vector<cv::KeyPoint> mvCurrentKeys,mvCurrentKeysRight;
vector<bool> mvbMap, mvbVO;
bool mbOnlyTracking;
int mnTracked, mnTrackedVO;
vector<cv::KeyPoint> mvIniKeys;
vector<int> mvIniMatches;
int mState;
std::vector<float> mvCurrentDepth;
float mThDepth;
Atlas* mpAtlas;
std::mutex mMutex;
vector<pair<cv::Point2f, cv::Point2f> > mvTracks;
Frame mCurrentFrame;
vector<MapPoint*> mvpLocalMap;
vector<cv::KeyPoint> mvMatchedKeys;
vector<MapPoint*> mvpMMethodology: Repobility · https://repobility.com/research/state-of-ai-code-2026/
Frame class · c · L52-L370 (319 LOC)include/Frame.h
class Frame
{
public:
Frame();
// Copy constructor.
Frame(const Frame &frame);
// Constructor for stereo cameras.
Frame(const cv::Mat &imLeft, const cv::Mat &imRight, const double &timeStamp, ORBextractor* extractorLeft, ORBextractor* extractorRight, ORBVocabulary* voc, cv::Mat &K, cv::Mat &distCoef, const float &bf, const float &thDepth, GeometricCamera* pCamera,Frame* pPrevF = static_cast<Frame*>(NULL), const IMU::Calib &ImuCalib = IMU::Calib());
// Constructor for RGB-D cameras.
Frame(const cv::Mat &imGray, const cv::Mat &imDepth, const double &timeStamp, ORBextractor* extractor,ORBVocabulary* voc, cv::Mat &K, cv::Mat &distCoef, const float &bf, const float &thDepth, GeometricCamera* pCamera,Frame* pPrevF = static_cast<Frame*>(NULL), const IMU::Calib &ImuCalib = IMU::Calib());
// Constructor for Monocular cameras.
Frame(const cv::Mat &imGray, const double &timeStamp, ORBextractor* extractor,ORBVocabulary* voc, GeometricCamera* pCamera, cv::MaGetCameraCenter method · c · L135-L137 (3 LOC)include/Frame.h
inline Eigen::Vector3f GetCameraCenter(){
return mOw;
}GetRotationInverse method · c · L140-L142 (3 LOC)include/Frame.h
inline Eigen::Matrix3f GetRotationInverse(){
return mRwc;
}GetPose method · c · L143-L147 (5 LOC)include/Frame.h
inline Sophus::SE3<float> GetPose() const {
//TODO: can the Frame pose be accsessed from several threads? should this be protected somehow?
return mTcw;
}GetRwc method · c · L148-L151 (4 LOC)include/Frame.h
inline Eigen::Matrix3f GetRwc() const {
return mRwc;
}GetOw method · c · L152-L155 (4 LOC)include/Frame.h
inline Eigen::Vector3f GetOw() const {
return mOw;
}HasPose method · c · L156-L159 (4 LOC)include/Frame.h
inline bool HasPose() const {
return mbHasPose;
}HasVelocity method · c · L160-L163 (4 LOC)include/Frame.h
inline bool HasVelocity() const {
return mbHasVelocity;
}Repobility · severity-and-effort ranking · https://repobility.com
PrintPointDistribution method · c · L356-L367 (12 LOC)include/Frame.h
void PrintPointDistribution(){
int left = 0, right = 0;
int Nlim = (Nleft != -1) ? Nleft : N;
for(int i = 0; i < N; i++){
if(mvpMapPoints[i] && !mvbOutlier[i]){
if(i < Nlim) left++;
else right++;
}
}
cout << "Point distribution in Frame: left-> " << left << " --- right-> " << right << endl;
}NormalizeRotation function · c · L68-L71 (4 LOC)include/G2oTypes.h
Eigen::Matrix<T,3,3> NormalizeRotation(const Eigen::Matrix<T,3,3> &R) {
Eigen::JacobiSVD<Eigen::Matrix<T,3,3>> svd(R,Eigen::ComputeFullU | Eigen::ComputeFullV);
return svd.matrixU() * svd.matrixV().transpose();
}ImuCamPose class · c · L72-L110 (39 LOC)include/G2oTypes.h
class ImuCamPose
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
ImuCamPose(){}
ImuCamPose(KeyFrame* pKF);
ImuCamPose(Frame* pF);
ImuCamPose(Eigen::Matrix3d &_Rwc, Eigen::Vector3d &_twc, KeyFrame* pKF);
void SetParam(const std::vector<Eigen::Matrix3d> &_Rcw, const std::vector<Eigen::Vector3d> &_tcw, const std::vector<Eigen::Matrix3d> &_Rbc,
const std::vector<Eigen::Vector3d> &_tbc, const double &_bf);
void Update(const double *pu); // update in the imu reference
void UpdateW(const double *pu); // update in the world reference
Eigen::Vector2d Project(const Eigen::Vector3d &Xw, int cam_idx=0) const; // Mono
Eigen::Vector3d ProjectStereo(const Eigen::Vector3d &Xw, int cam_idx=0) const; // Stereo
bool isDepthPositive(const Eigen::Vector3d &Xw, int cam_idx=0) const;
public:
// For IMU
Eigen::Matrix3d Rwb;
Eigen::Vector3d twb;
// For set of cameras
std::vector<Eigen::Matrix3d> Rcw;
std::vector<Eigen::VectorImuCamPose method · c · L76-L78 (3 LOC)include/G2oTypes.h
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
ImuCamPose(){}InvDepthPoint class · c · L111-L127 (17 LOC)include/G2oTypes.h
class InvDepthPoint
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
InvDepthPoint(){}
InvDepthPoint(double _rho, double _u, double _v, KeyFrame* pHostKF);
void Update(const double *pu);
double rho;
double u, v; // they are not variables, observation in the host frame
double fx, fy, cx, cy, bf; // from host frame
int its;
};InvDepthPoint method · c · L114-L116 (3 LOC)include/G2oTypes.h
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
InvDepthPoint(){}VertexPose class · c · L130-L153 (24 LOC)include/G2oTypes.h
class VertexPose : public g2o::BaseVertex<6,ImuCamPose>
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexPose(){}
VertexPose(KeyFrame* pKF){
setEstimate(ImuCamPose(pKF));
}
VertexPose(Frame* pF){
setEstimate(ImuCamPose(pF));
}
virtual bool read(std::istream& is);
virtual bool write(std::ostream& os) const;
virtual void setToOriginImpl() {
}
virtual void oplusImpl(const double* update_){
_estimate.Update(update_);
updateCache();
}
};VertexPose method · c · L132-L134 (3 LOC)include/G2oTypes.h
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexPose(){}Repobility — the code-quality scanner for AI-generated software · https://repobility.com
VertexPose method · c · L135-L137 (3 LOC)include/G2oTypes.h
VertexPose(KeyFrame* pKF){
setEstimate(ImuCamPose(pKF));
}VertexPose method · c · L138-L140 (3 LOC)include/G2oTypes.h
VertexPose(Frame* pF){
setEstimate(ImuCamPose(pF));
}setToOriginImpl method · c · L145-L147 (3 LOC)include/G2oTypes.h
virtual void setToOriginImpl() {
}oplusImpl method · c · L148-L152 (5 LOC)include/G2oTypes.h
virtual void oplusImpl(const double* update_){
_estimate.Update(update_);
updateCache();
}VertexPose4DoF class · c · L154-L189 (36 LOC)include/G2oTypes.h
class VertexPose4DoF : public g2o::BaseVertex<4,ImuCamPose>
{
// Translation and yaw are the only optimizable variables
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexPose4DoF(){}
VertexPose4DoF(KeyFrame* pKF){
setEstimate(ImuCamPose(pKF));
}
VertexPose4DoF(Frame* pF){
setEstimate(ImuCamPose(pF));
}
VertexPose4DoF(Eigen::Matrix3d &_Rwc, Eigen::Vector3d &_twc, KeyFrame* pKF){
setEstimate(ImuCamPose(_Rwc, _twc, pKF));
}
virtual bool read(std::istream& is){return false;}
virtual bool write(std::ostream& os) const{return false;}
virtual void setToOriginImpl() {
}
virtual void oplusImpl(const double* update_){
double update6DoF[6];
update6DoF[0] = 0;
update6DoF[1] = 0;
update6DoF[2] = update_[0];
update6DoF[3] = update_[1];
update6DoF[4] = update_[2];
update6DoF[5] = update_[3];
_estimate.UpdateW(update6DoF);
updateCache();
}
};VertexPose4DoF method · c · L158-L160 (3 LOC)include/G2oTypes.h
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexPose4DoF(){}VertexPose4DoF method · c · L161-L163 (3 LOC)include/G2oTypes.h
VertexPose4DoF(KeyFrame* pKF){
setEstimate(ImuCamPose(pKF));
}VertexPose4DoF method · c · L164-L166 (3 LOC)include/G2oTypes.h
VertexPose4DoF(Frame* pF){
setEstimate(ImuCamPose(pF));
}Open data scored by Repobility · https://repobility.com
VertexPose4DoF method · c · L167-L170 (4 LOC)include/G2oTypes.h
VertexPose4DoF(Eigen::Matrix3d &_Rwc, Eigen::Vector3d &_twc, KeyFrame* pKF){
setEstimate(ImuCamPose(_Rwc, _twc, pKF));
}setToOriginImpl method · c · L174-L176 (3 LOC)include/G2oTypes.h
virtual void setToOriginImpl() {
}oplusImpl method · c · L177-L188 (12 LOC)include/G2oTypes.h
virtual void oplusImpl(const double* update_){
double update6DoF[6];
update6DoF[0] = 0;
update6DoF[1] = 0;
update6DoF[2] = update_[0];
update6DoF[3] = update_[1];
update6DoF[4] = update_[2];
update6DoF[5] = update_[3];
_estimate.UpdateW(update6DoF);
updateCache();
}VertexVelocity class · c · L190-L210 (21 LOC)include/G2oTypes.h
class VertexVelocity : public g2o::BaseVertex<3,Eigen::Vector3d>
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexVelocity(){}
VertexVelocity(KeyFrame* pKF);
VertexVelocity(Frame* pF);
virtual bool read(std::istream& is){return false;}
virtual bool write(std::ostream& os) const{return false;}
virtual void setToOriginImpl() {
}
virtual void oplusImpl(const double* update_){
Eigen::Vector3d uv;
uv << update_[0], update_[1], update_[2];
setEstimate(estimate()+uv);
}
};VertexVelocity method · c · L193-L195 (3 LOC)include/G2oTypes.h
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexVelocity(){}setToOriginImpl method · c · L201-L203 (3 LOC)include/G2oTypes.h
virtual void setToOriginImpl() {
}oplusImpl method · c · L204-L209 (6 LOC)include/G2oTypes.h
virtual void oplusImpl(const double* update_){
Eigen::Vector3d uv;
uv << update_[0], update_[1], update_[2];
setEstimate(estimate()+uv);
}VertexGyroBias class · c · L211-L231 (21 LOC)include/G2oTypes.h
class VertexGyroBias : public g2o::BaseVertex<3,Eigen::Vector3d>
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexGyroBias(){}
VertexGyroBias(KeyFrame* pKF);
VertexGyroBias(Frame* pF);
virtual bool read(std::istream& is){return false;}
virtual bool write(std::ostream& os) const{return false;}
virtual void setToOriginImpl() {
}
virtual void oplusImpl(const double* update_){
Eigen::Vector3d ubg;
ubg << update_[0], update_[1], update_[2];
setEstimate(estimate()+ubg);
}
};Methodology: Repobility · https://repobility.com/research/state-of-ai-code-2026/
VertexGyroBias method · c · L214-L216 (3 LOC)include/G2oTypes.h
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexGyroBias(){}setToOriginImpl method · c · L222-L224 (3 LOC)include/G2oTypes.h
virtual void setToOriginImpl() {
}oplusImpl method · c · L225-L230 (6 LOC)include/G2oTypes.h
virtual void oplusImpl(const double* update_){
Eigen::Vector3d ubg;
ubg << update_[0], update_[1], update_[2];
setEstimate(estimate()+ubg);
}VertexAccBias class · c · L232-L253 (22 LOC)include/G2oTypes.h
class VertexAccBias : public g2o::BaseVertex<3,Eigen::Vector3d>
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexAccBias(){}
VertexAccBias(KeyFrame* pKF);
VertexAccBias(Frame* pF);
virtual bool read(std::istream& is){return false;}
virtual bool write(std::ostream& os) const{return false;}
virtual void setToOriginImpl() {
}
virtual void oplusImpl(const double* update_){
Eigen::Vector3d uba;
uba << update_[0], update_[1], update_[2];
setEstimate(estimate()+uba);
}
};VertexAccBias method · c · L236-L238 (3 LOC)include/G2oTypes.h
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexAccBias(){}setToOriginImpl method · c · L244-L246 (3 LOC)include/G2oTypes.h
virtual void setToOriginImpl() {
}oplusImpl method · c · L247-L252 (6 LOC)include/G2oTypes.h
virtual void oplusImpl(const double* update_){
Eigen::Vector3d uba;
uba << update_[0], update_[1], update_[2];
setEstimate(estimate()+uba);
}GDirection class · c · L257-L272 (16 LOC)include/G2oTypes.h
class GDirection
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
GDirection(){}
GDirection(Eigen::Matrix3d pRwg): Rwg(pRwg){}
void Update(const double *pu)
{
Rwg=Rwg*ExpSO3(pu[0],pu[1],0.0);
}
Eigen::Matrix3d Rwg, Rgw;
int its;
};Repobility · severity-and-effort ranking · https://repobility.com
GDirection method · c · L259-L261 (3 LOC)include/G2oTypes.h
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
GDirection(){}Update method · c · L263-L267 (5 LOC)include/G2oTypes.h
void Update(const double *pu)
{
Rwg=Rwg*ExpSO3(pu[0],pu[1],0.0);
}VertexGDir class · c · L273-L293 (21 LOC)include/G2oTypes.h
class VertexGDir : public g2o::BaseVertex<2,GDirection>
{
public:
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
VertexGDir(){}
VertexGDir(Eigen::Matrix3d pRwg){
setEstimate(GDirection(pRwg));
}
virtual bool read(std::istream& is){return false;}
virtual bool write(std::ostream& os) const{return false;}
virtual void setToOriginImpl() {
}
virtual void oplusImpl(const double* update_){
_estimate.Update(update_);
updateCache();
}
};