Eigen alignment fix

This commit is contained in:
akira_you
2017-03-25 05:57:53 +09:00
parent 80744bbe42
commit ec240827b1
9 changed files with 36 additions and 35 deletions
+1 -1
View File
@@ -116,7 +116,7 @@ public:
/// Can be used to compute the Next-Best-View in parallel.
/// IMPORTANT! Make sure you hold a valid reference counting pointer to frame
/// so it is not being deleted while you use it.
void getSeedsCopy(const FramePtr& frame, std::list<Seed>& seeds);
void getSeedsCopy(const FramePtr& frame, std::list<Seed, aligned_allocator<Seed> >& seeds);
/// Return a reference to the seeds. This is NOT THREAD SAFE!
std::list<Seed, aligned_allocator<Seed> >& getSeeds() { return seeds_; }
+4
View File
@@ -25,6 +25,10 @@
#include <math.h>
#include <Eigen/Core>
template <class T, class Allocator = Eigen::aligned_allocator<std::pair<const int,T>> >
using vectorA = std::vector< T, Allocator > ;
template <class T, class Allocator = Eigen::aligned_allocator<std::pair<const int,T>> >
using listA = std::list< T, Allocator > ;
#include <opencv2/opencv.hpp>
#include <sophus/se3.h>
#include <vikit/performance_monitor.h>
+9 -9
View File
@@ -44,11 +44,11 @@ public:
protected:
vector<cv::Point2f> px_ref_; //!< keypoints to be tracked in reference frame.
vector<cv::Point2f> px_cur_; //!< tracked keypoints in current frame.
vector<Vector3d> f_ref_; //!< bearing vectors corresponding to the keypoints in the reference image.
vector<Vector3d> f_cur_; //!< bearing vectors corresponding to the keypoints in the current image.
vectorA<Vector3d> f_ref_; //!< bearing vectors corresponding to the keypoints in the reference image.
vectorA<Vector3d> f_cur_; //!< bearing vectors corresponding to the keypoints in the current image.
vector<double> disparities_; //!< disparity between first and second frame.
vector<int> inliers_; //!< inliers after the geometric check (e.g., Homography).
vector<Vector3d> xyz_in_cur_; //!< 3D points computed during the geometric check.
vectorA<Vector3d> xyz_in_cur_; //!< 3D points computed during the geometric check.
SE3 T_cur_from_ref_; //!< computed transformation between the first two frames.
};
@@ -56,7 +56,7 @@ protected:
void detectFeatures(
FramePtr frame,
vector<cv::Point2f>& px_vec,
vector<Vector3d>& f_vec);
vectorA<Vector3d>& f_vec);
/// Compute optical flow (Lucas Kanade) for selected keypoints.
void trackKlt(
@@ -64,17 +64,17 @@ void trackKlt(
FramePtr frame_cur,
vector<cv::Point2f>& px_ref,
vector<cv::Point2f>& px_cur,
vector<Vector3d>& f_ref,
vector<Vector3d>& f_cur,
vectorA<Vector3d>& f_ref,
vectorA<Vector3d>& f_cur,
vector<double>& disparities);
void computeHomography(
const vector<Vector3d>& f_ref,
const vector<Vector3d>& f_cur,
const vectorA<Vector3d>& f_ref,
const vectorA<Vector3d>& f_cur,
double focal_length,
double reprojection_threshold,
vector<int>& inliers,
vector<Vector3d>& xyz_in_cur,
vectorA<Vector3d>& xyz_in_cur,
SE3& T_cur_from_ref);
} // namespace initialization
+1 -1
View File
@@ -72,7 +72,7 @@ private:
Vector2d px; //!< projected 2D pixel location.
Candidate(Point* pt, Vector2d& px) : pt(pt), px(px) {}
};
typedef std::list<Candidate, aligned_allocator<Candidate> > Cell;
typedef std::list<Candidate > Cell;
typedef std::vector<Cell*> CandidateGrid;
/// The grid stores a set of candidate matches. For every grid cell we try to find one match.