48 : timestamp_(timestamp),
103 std::shared_ptr<const okvis::kinematics::Transformation>
MultiFrame::T_SC(
size_t cameraIdx)
const {
116 frames_[cameraIdx].setImage(image);
121 size_t cameraIdx, std::shared_ptr<const cameras::CameraBase> cameraGeometry)
124 frames_[cameraIdx].setGeometry(cameraGeometry);
129 std::shared_ptr<cv::FeatureDetector> detector)
132 frames_[cameraIdx].setDetector(detector);
137 size_t cameraIdx, std::shared_ptr<cv::DescriptorExtractor> extractor)
140 frames_[cameraIdx].setExtractor(extractor);
147 return frames_[cameraIdx].image();
152 size_t cameraIdx)
const
155 return frames_[cameraIdx].geometry();
159 template<
class GEOMETRY_T>
163 return frames_[cameraIdx].geometryAs<GEOMETRY_T>();
172 return frames_[cameraIdx].detect();
180 const Eigen::Vector3d & extractionDirection)
183 return frames_[cameraIdx].describe(extractionDirection);
185 template<
class GEOMETRY_T>
187 const Eigen::Vector3d & extractionDirection)
190 return frames_[cameraIdx].template describeAs <GEOMETRY_T> (extractionDirection);
195 cv::KeyPoint & keypoint)
const
198 return frames_[cameraIdx].getCvKeypoint(keypointIdx, keypoint);
203 Eigen::Vector2d & keypoint)
const
206 return frames_[cameraIdx].getKeypoint(keypointIdx, keypoint);
211 double & keypointSize)
const
214 return frames_[cameraIdx].getKeypointSize(keypointIdx, keypointSize);
223 return frames_[cameraIdx].keypointDescriptor(keypointIdx);
231 return frames_[cameraIdx].setLandmarkId(keypointIdx, landmarkId);
238 return frames_[cameraIdx].landmarkId(keypointIdx);
245 return frames_[cameraIdx].numKeypoints();
251 return frames_[cameraIdx].resetKeypoints(keypoints);
257 return frames_[cameraIdx].resetDescriptors(descriptors);
266 for (
size_t i = 0; i <
frames_.size(); ++i) {
267 numKeypoints +=
frames_[i].numKeypoints();
bool setLandmarkId(size_t cameraIdx, size_t keypointIdx, uint64_t landmarkId)
Set the landmark ID.
Definition: MultiFrame.hpp:227
uint64_t landmarkId(size_t cameraIdx, size_t keypointIdx) const
Access the landmark ID.
Definition: MultiFrame.hpp:235
void resetCameraSystemAndFrames(const cameras::NCameraSystem &cameraSystem)
(Re)set the NCameraSystem – which clears the frames as well.
Definition: MultiFrame.hpp:60
bool resetKeypoints(size_t cameraIdx, const std::vector< cv::KeyPoint > &keypoints)
provide keypoints externally
Definition: MultiFrame.hpp:249
void setId(uint64_t id)
(Re)set the id
Definition: MultiFrame.hpp:80
std::shared_ptr< const okvis::kinematics::Transformation > T_SC(size_t cameraIdx) const
Get the extrinsics of a camera.
Definition: MultiFrame.hpp:103
std::vector< Frame, Eigen::aligned_allocator< Frame > > frames_
the individual frames
Definition: MultiFrame.hpp:268
const unsigned char * keypointDescriptor(size_t cameraIdx, size_t keypointIdx)
Access the descriptor – CAUTION: high-speed version.
Definition: MultiFrame.hpp:219
bool getKeypointSize(size_t cameraIdx, size_t keypointIdx, double &keypointSize) const
Get the size of a specific keypoint.
Definition: MultiFrame.hpp:210
void setImage(size_t cameraIdx, const cv::Mat &image)
Set the frame image;.
Definition: MultiFrame.hpp:113
void setGeometry(size_t cameraIdx, std::shared_ptr< const cameras::CameraBase > cameraGeometry)
Set the geometry.
Definition: MultiFrame.hpp:120
std::shared_ptr< const okvis::kinematics::Transformation > T_SC(size_t cameraIndex) const
get the pose of the IMU frame S with respect to the camera cameraIndex
Definition: NCameraSystem.hpp:119
A class that assembles multiple cameras into a system of (potentially different) cameras.
Definition: NCameraSystem.hpp:61
std::shared_ptr< const GEOMETRY_T > geometryAs(size_t cameraIdx) const
Get the specific geometry (will be fast to use)
Definition: MultiFrame.hpp:160
const cv::Mat & image(size_t cameraIdx) const
Obtain the image.
Definition: MultiFrame.hpp:144
uint64_t id_
the frame id
Definition: MultiFrame.hpp:267
bool resetDescriptors(size_t cameraIdx, const cv::Mat &descriptors)
provide descriptors externally
Definition: MultiFrame.hpp:255
int describe(size_t cameraIdx, 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: MultiFrame.hpp:179
void setDetector(size_t cameraIdx, std::shared_ptr< cv::FeatureDetector > detector)
Set the detector.
Definition: MultiFrame.hpp:128
bool getCvKeypoint(size_t cameraIdx, size_t keypointIdx, cv::KeyPoint &keypoint) const
Access a specific keypoint in OpenCV format.
Definition: MultiFrame.hpp:194
int describeAs(size_t cameraIdx, 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: MultiFrame.hpp:186
size_t numFrames() const
The number of frames/cameras.
Definition: MultiFrame.hpp:98
size_t numKeypoints() const
Get the total number of keypoints in all frames.
Definition: MultiFrame.hpp:263
virtual ~MultiFrame()
Destructor...
Definition: MultiFrame.hpp:54
int detect(size_t cameraIdx)
Detect keypoints. This uses virtual function calls. That's a negligibly small overhead for many detec...
Definition: MultiFrame.hpp:169
EIGEN_MAKE_ALIGNED_OPERATOR_NEW MultiFrame()
Default constructor.
Definition: MultiFrame.hpp:43
void setExtractor(size_t cameraIdx, std::shared_ptr< cv::DescriptorExtractor > extractor)
Set the extractor.
Definition: MultiFrame.hpp:136
void setTimestamp(const okvis::Time ×tamp)
(Re)set the timestamp
Definition: MultiFrame.hpp:74
okvis::Time timestamp_
the frame timestamp
Definition: MultiFrame.hpp:266
uint64_t id() const
Obtain the frame id.
Definition: MultiFrame.hpp:92
std::shared_ptr< const cameras::CameraBase > geometry(size_t cameraIdx) const
get the base class geometry (will be slow to use)
Definition: MultiFrame.hpp:151
Time representation. May either represent wall clock time or ROS clock time.
Definition: Time.hpp:187
bool getKeypoint(size_t cameraIdx, size_t keypointIdx, Eigen::Vector2d &keypoint) const
Get a specific keypoint.
Definition: MultiFrame.hpp:202
size_t numCameras() const
Obtatin the number of cameras currently added.
Definition: NCameraSystem.hpp:202
#define OKVIS_ASSERT_TRUE_DBG(exceptionType, condition, message)
Definition: assert_macros.hpp:211
std::shared_ptr< const cameras::CameraBase > cameraGeometry(size_t cameraIndex) const
get the camera geometry of camera cameraIndex
Definition: NCameraSystem.hpp:128
const okvis::Time & timestamp() const
Obtain the frame timestamp.
Definition: MultiFrame.hpp:86
cameras::NCameraSystem cameraSystem_
the camera system
Definition: MultiFrame.hpp:269