41 #ifndef INCLUDE_OKVIS_FRAME_HPP_
42 #define INCLUDE_OKVIS_FRAME_HPP_
44 #include <Eigen/StdVector>
47 #pragma GCC diagnostic push
48 #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
49 #include <opencv2/core/core.hpp>
50 #pragma GCC diagnostic pop
51 #pragma GCC diagnostic push
52 #pragma GCC diagnostic ignored "-Woverloaded-virtual"
53 #include <opencv2/features2d/features2d.hpp>
54 #pragma GCC diagnostic pop
67 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
82 std::shared_ptr<cameras::CameraBase> & cameraGeometry,
83 std::shared_ptr<cv::FeatureDetector> & detector,
84 std::shared_ptr<cv::DescriptorExtractor> & extractor);
97 inline void setGeometry(std::shared_ptr<const cameras::CameraBase> cameraGeometry);
101 inline void setDetector(std::shared_ptr<cv::FeatureDetector> detector);
105 inline void setExtractor(std::shared_ptr<cv::DescriptorExtractor> extractor);
109 inline const cv::Mat &
image()
const;
113 inline std::shared_ptr<const cameras::CameraBase>
geometry()
const;
118 template<
class GEOMETRY_T>
119 inline std::shared_ptr<const GEOMETRY_T>
geometryAs()
const;
131 const Eigen::Vector3d & extractionDirection = Eigen::Vector3d(0, 0, 1));
138 template<
class GEOMETRY_T>
140 const Eigen::Vector3d & extractionDirection = Eigen::Vector3d(0, 0, 1));
146 inline bool getCvKeypoint(
size_t keypointIdx, cv::KeyPoint & keypoint)
const;
152 inline bool getKeypoint(
size_t keypointIdx, Eigen::Vector2d & keypoint)
const;
158 inline bool getKeypointSize(
size_t keypointIdx,
double & keypointSize)
const;
174 inline uint64_t
landmarkId(
size_t keypointIdx)
const;
179 inline bool resetKeypoints(
const std::vector<cv::KeyPoint> & keypoints);
EIGEN_MAKE_ALIGNED_OPERATOR_NEW Frame()
a default constructor
Definition: Frame.hpp:71
Header implementation file for the Frame class.
uint64_t landmarkId(size_t keypointIdx) const
Access the landmark ID.
Definition: Frame.hpp:278
std::shared_ptr< const cameras::CameraBase > cameraGeometry_
the camera geometry
Definition: Frame.hpp:192
int describe(const Eigen::Vector3d &extractionDirection=Eigen::Vector3d(0, 0, 1))
Describe keypoints. This uses virtual function calls. That's a negligibly small overhead for many det...
Definition: Frame.hpp:128
cv::Mat descriptors_
we store the descriptors using OpenCV's matrices
Definition: Frame.hpp:196
A single camera frame equipped with keypoint detector / extractor.
Definition: Frame.hpp:64
cv::Mat image_
the image as OpenCV's matrix
Definition: Frame.hpp:191
bool resetDescriptors(const cv::Mat &descriptors)
provide descriptors externally
Definition: Frame.hpp:300
std::vector< uint64_t > landmarkIds_
landmark Id, if associated – 0 otherwise
Definition: Frame.hpp:197
Header file for the TimeBase, Time and WallTime class.
int detect()
Detect keypoints. This uses virtual function calls. That's a negligibly small overhead for many detec...
Definition: Frame.hpp:110
bool getKeypoint(size_t keypointIdx, Eigen::Vector2d &keypoint) const
Get a specific keypoint.
Definition: Frame.hpp:210
const cv::Mat & image() const
Obtain the image.
Definition: Frame.hpp:82
bool getCvKeypoint(size_t keypointIdx, cv::KeyPoint &keypoint) const
Access a specific keypoint in OpenCV format.
Definition: Frame.hpp:193
#define OKVIS_DEFINE_EXCEPTION(exceptionName, exceptionParent)
Macro for defining an exception with a given parent.
Definition: assert_macros.hpp:52
std::shared_ptr< cv::FeatureDetector > detector_
the detector
Definition: Frame.hpp:193
bool getKeypointSize(size_t keypointIdx, double &keypointSize) const
Get the size of a specific keypoint.
Definition: Frame.hpp:228
This file contains some useful assert macros.
std::vector< cv::KeyPoint > keypoints_
we store keypoints using OpenCV's struct
Definition: Frame.hpp:195
int describeAs(const Eigen::Vector3d &extractionDirection=Eigen::Vector3d(0, 0, 1))
Describe keypoints. This uses virtual function calls. That's a negligibly small overhead for many det...
Definition: Frame.hpp:162
std::shared_ptr< cv::DescriptorExtractor > extractor_
the extractor
Definition: Frame.hpp:194
std::shared_ptr< const cameras::CameraBase > geometry() const
get the base class geometry (will be slow to use)
Definition: Frame.hpp:88
void setExtractor(std::shared_ptr< cv::DescriptorExtractor > extractor)
Set the extractor.
Definition: Frame.hpp:76
bool resetKeypoints(const std::vector< cv::KeyPoint > &keypoints)
Provide keypoints externally.
Definition: Frame.hpp:293
const unsigned char * keypointDescriptor(size_t keypointIdx)
Access the descriptor – CAUTION: high-speed version.
Definition: Frame.hpp:246
Header file for the CameraBase class.
bool setLandmarkId(size_t keypointIdx, uint64_t landmarkId)
Set the landmark ID.
Definition: Frame.hpp:261
std::shared_ptr< const GEOMETRY_T > geometryAs() const
Get the specific geometry (will be fast to use)
Definition: Frame.hpp:95
size_t numKeypoints() const
Get the number of keypoints.
Definition: Frame.hpp:305
virtual ~Frame()
A simple destructor.
Definition: Frame.hpp:87
void setDetector(std::shared_ptr< cv::FeatureDetector > detector)
Set the detector.
Definition: Frame.hpp:70
void setGeometry(std::shared_ptr< const cameras::CameraBase > cameraGeometry)
Set the geometry.
Definition: Frame.hpp:64
void setImage(const cv::Mat &image)
Set the frame image;.
Definition: Frame.hpp:58