OKVIS ROS
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
okvis::MultiFrame Class Reference

A multi camera frame that uses okvis::Frame underneath. More...

#include <MultiFrame.hpp>

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW MultiFrame ()
 Default constructor. More...
 
 MultiFrame (const cameras::NCameraSystem &cameraSystem, const okvis::Time &timestamp, uint64_t id=0)
 Construct from NCameraSystem. More...
 
virtual ~MultiFrame ()
 Destructor... More...
 
void resetCameraSystemAndFrames (const cameras::NCameraSystem &cameraSystem)
 (Re)set the NCameraSystem – which clears the frames as well. More...
 
void setTimestamp (const okvis::Time &timestamp)
 (Re)set the timestamp More...
 
void setId (uint64_t id)
 (Re)set the id More...
 
const okvis::Timetimestamp () const
 Obtain the frame timestamp. More...
 
uint64_t id () const
 Obtain the frame id. More...
 
size_t numFrames () const
 The number of frames/cameras. More...
 
std::shared_ptr< const
okvis::kinematics::Transformation
T_SC (size_t cameraIdx) const
 Get the extrinsics of a camera. More...
 
size_t numKeypoints () const
 Get the total number of keypoints in all frames. More...
 
const cv::Mat overlap (size_t cameraIndexSeenBy, size_t cameraIndex) const
 Get the overlap mask. Sorry for the weird syntax, but remember that cv::Mat is essentially a shared pointer. More...
 
bool hasOverlap (size_t cameraIndexSeenBy, size_t cameraIndex) const
 Can the first camera see parts of the FOV of the second camera? More...
 
The following mirror the Frame functionality.
void setImage (size_t cameraIdx, const cv::Mat &image)
 Set the frame image;. More...
 
void setGeometry (size_t cameraIdx, std::shared_ptr< const cameras::CameraBase > cameraGeometry)
 Set the geometry. More...
 
void setDetector (size_t cameraIdx, std::shared_ptr< cv::FeatureDetector > detector)
 Set the detector. More...
 
void setExtractor (size_t cameraIdx, std::shared_ptr< cv::DescriptorExtractor > extractor)
 Set the extractor. More...
 
const cv::Mat & image (size_t cameraIdx) const
 Obtain the image. More...
 
std::shared_ptr< const
cameras::CameraBase
geometry (size_t cameraIdx) const
 get the base class geometry (will be slow to use) More...
 
template<class GEOMETRY_T >
std::shared_ptr< const GEOMETRY_T > geometryAs (size_t cameraIdx) const
 Get the specific geometry (will be fast to use) More...
 
int detect (size_t cameraIdx)
 Detect keypoints. This uses virtual function calls. That's a negligibly small overhead for many detections. More...
 
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 detections. More...
 
template<class GEOMETRY_T >
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 detections. More...
 
bool getCvKeypoint (size_t cameraIdx, size_t keypointIdx, cv::KeyPoint &keypoint) const
 Access a specific keypoint in OpenCV format. More...
 
bool getKeypoint (size_t cameraIdx, size_t keypointIdx, Eigen::Vector2d &keypoint) const
 Get a specific keypoint. More...
 
bool getKeypointSize (size_t cameraIdx, size_t keypointIdx, double &keypointSize) const
 Get the size of a specific keypoint. More...
 
const unsigned char * keypointDescriptor (size_t cameraIdx, size_t keypointIdx)
 Access the descriptor – CAUTION: high-speed version. More...
 
bool setLandmarkId (size_t cameraIdx, size_t keypointIdx, uint64_t landmarkId)
 Set the landmark ID. More...
 
uint64_t landmarkId (size_t cameraIdx, size_t keypointIdx) const
 Access the landmark ID. More...
 
bool resetKeypoints (size_t cameraIdx, const std::vector< cv::KeyPoint > &keypoints)
 provide keypoints externally More...
 
bool resetDescriptors (size_t cameraIdx, const cv::Mat &descriptors)
 provide descriptors externally More...
 
size_t numKeypoints (size_t cameraIdx) const
 the number of keypoints More...
 

Protected Attributes

okvis::Time timestamp_
 the frame timestamp More...
 
uint64_t id_
 the frame id More...
 
std::vector< Frame,
Eigen::aligned_allocator
< Frame > > 
frames_
 the individual frames More...
 
cameras::NCameraSystem cameraSystem_
 the camera system More...
 

Detailed Description

A multi camera frame that uses okvis::Frame underneath.

Constructor & Destructor Documentation

okvis::MultiFrame::MultiFrame ( )
inline

Default constructor.

okvis::MultiFrame::MultiFrame ( const cameras::NCameraSystem cameraSystem,
const okvis::Time timestamp,
uint64_t  id = 0 
)
inline

Construct from NCameraSystem.

Parameters
[in]cameraSystemThe camera system for which this is a multi-frame.
[in]timestampThe time this frame was recorded.
[in]idA unique frame Id.
okvis::MultiFrame::~MultiFrame ( )
inlinevirtual

Destructor...

Member Function Documentation

int okvis::MultiFrame::describe ( size_t  cameraIdx,
const Eigen::Vector3d &  extractionDirection = Eigen::Vector3d(0, 0, 1) 
)
inline

Describe keypoints. This uses virtual function calls. That's a negligibly small overhead for many detections.

Parameters
[in]cameraIdxThe camera index.
[in]extractionDirectionThe extraction direction in camera frame
Returns
the number of detected points.

That's a negligibly small overhead for many detections.

Parameters
extractionDirectionthe extraction direction in camera frame returns the number of detected points.
template<class GEOMETRY_T >
int okvis::MultiFrame::describeAs ( size_t  cameraIdx,
const Eigen::Vector3d &  extractionDirection = Eigen::Vector3d(0, 0, 1) 
)
inline

Describe keypoints. This uses virtual function calls. That's a negligibly small overhead for many detections.

Template Parameters
GEOMETRY_TThe type for the camera geometry requested.
Parameters
[in]cameraIdxThe camera index.
[in]extractionDirectionThe extraction direction in camera frame
Returns
the number of detected points.
int okvis::MultiFrame::detect ( size_t  cameraIdx)
inline

Detect keypoints. This uses virtual function calls. That's a negligibly small overhead for many detections.

Returns
The number of detected points.

That's a negligibly small overhead for many detections. returns the number of detected points.

std::shared_ptr< const cameras::CameraBase > okvis::MultiFrame::geometry ( size_t  cameraIdx) const
inline

get the base class geometry (will be slow to use)

Parameters
[in]cameraIdxThe camera index.
Returns
The camera geometry.
template<class GEOMETRY_T >
std::shared_ptr< const GEOMETRY_T > okvis::MultiFrame::geometryAs ( size_t  cameraIdx) const
inline

Get the specific geometry (will be fast to use)

Template Parameters
GEOMETRY_TThe type for the camera geometry requested.
Parameters
[in]cameraIdxThe camera index.
Returns
The camera geometry.
bool okvis::MultiFrame::getCvKeypoint ( size_t  cameraIdx,
size_t  keypointIdx,
cv::KeyPoint &  keypoint 
) const
inline

Access a specific keypoint in OpenCV format.

Parameters
[in]cameraIdxThe camera index.
[in]keypointIdxThe requested keypoint's index.
[out]keypointThe requested keypoint.
Returns
whether or not the operation was successful.
bool okvis::MultiFrame::getKeypoint ( size_t  cameraIdx,
size_t  keypointIdx,
Eigen::Vector2d &  keypoint 
) const
inline

Get a specific keypoint.

Parameters
[in]cameraIdxThe camera index.
[in]keypointIdxThe requested keypoint's index.
[out]keypointThe requested keypoint.
Returns
whether or not the operation was successful.
bool okvis::MultiFrame::getKeypointSize ( size_t  cameraIdx,
size_t  keypointIdx,
double &  keypointSize 
) const
inline

Get the size of a specific keypoint.

Parameters
[in]cameraIdxThe camera index.
[in]keypointIdxThe requested keypoint's index.
[out]keypointSizeThe requested keypoint's size.
Returns
whether or not the operation was successful.
bool okvis::MultiFrame::hasOverlap ( size_t  cameraIndexSeenBy,
size_t  cameraIndex 
) const
inline

Can the first camera see parts of the FOV of the second camera?

Parameters
[in]cameraIndexSeenByThe camera index for one camera.
[in]cameraIndexThe camera index for the other camera.
Returns
True, if there is at least one pixel of overlap.
uint64_t okvis::MultiFrame::id ( ) const
inline

Obtain the frame id.

Returns
The unique frame Id.
const cv::Mat & okvis::MultiFrame::image ( size_t  cameraIdx) const
inline

Obtain the image.

Parameters
[in]cameraIdxThe camera index.
Returns
The image.
const unsigned char * okvis::MultiFrame::keypointDescriptor ( size_t  cameraIdx,
size_t  keypointIdx 
)
inline

Access the descriptor – CAUTION: high-speed version.

returns NULL if out of bounds.

Parameters
[in]cameraIdxThe camera index.
[in]keypointIdxThe requested keypoint's index.
Returns
The descriptor data pointer; NULL if out of bounds.
uint64_t okvis::MultiFrame::landmarkId ( size_t  cameraIdx,
size_t  keypointIdx 
) const
inline

Access the landmark ID.

Parameters
[in]cameraIdxThe camera index.
[in]keypointIdxThe requested keypoint's index.
Returns
The landmark Id.
size_t okvis::MultiFrame::numFrames ( ) const
inline

The number of frames/cameras.

Returns
How many individual frames/cameras there are.
size_t okvis::MultiFrame::numKeypoints ( size_t  cameraIdx) const
inline

the number of keypoints

Parameters
[in]cameraIdxThe camera index.
Returns
The number of keypoints.
size_t okvis::MultiFrame::numKeypoints ( ) const
inline

Get the total number of keypoints in all frames.

Returns
The total number of keypoints.
const cv::Mat okvis::MultiFrame::overlap ( size_t  cameraIndexSeenBy,
size_t  cameraIndex 
) const
inline

Get the overlap mask. Sorry for the weird syntax, but remember that cv::Mat is essentially a shared pointer.

Parameters
[in]cameraIndexSeenByThe camera index for one camera.
[in]cameraIndexThe camera index for the other camera.
Returns
The overlap mask image.
void okvis::MultiFrame::resetCameraSystemAndFrames ( const cameras::NCameraSystem cameraSystem)
inline

(Re)set the NCameraSystem – which clears the frames as well.

Parameters
[in]cameraSystemThe camera system for which this is a multi-frame.
bool okvis::MultiFrame::resetDescriptors ( size_t  cameraIdx,
const cv::Mat &  descriptors 
)
inline

provide descriptors externally

Parameters
[in]cameraIdxThe camera index.
[in]descriptorsA vector of descriptors.
Returns
whether or not the operation was successful.
bool okvis::MultiFrame::resetKeypoints ( size_t  cameraIdx,
const std::vector< cv::KeyPoint > &  keypoints 
)
inline

provide keypoints externally

Parameters
[in]cameraIdxThe camera index.
[in]keypointsA vector of keyoints.
Returns
whether or not the operation was successful.
void okvis::MultiFrame::setDetector ( size_t  cameraIdx,
std::shared_ptr< cv::FeatureDetector >  detector 
)
inline

Set the detector.

Parameters
[in]cameraIdxThe camera index.
[in]detectorThe detector to be used.
void okvis::MultiFrame::setExtractor ( size_t  cameraIdx,
std::shared_ptr< cv::DescriptorExtractor >  extractor 
)
inline

Set the extractor.

Parameters
[in]cameraIdxThe camera index.
[in]extractorThe extractor to be used.
void okvis::MultiFrame::setGeometry ( size_t  cameraIdx,
std::shared_ptr< const cameras::CameraBase cameraGeometry 
)
inline

Set the geometry.

Parameters
[in]cameraIdxThe camera index.
[in]cameraGeometryThe camera geometry.
void okvis::MultiFrame::setId ( uint64_t  id)
inline

(Re)set the id

Parameters
[in]idA unique frame Id.
void okvis::MultiFrame::setImage ( size_t  cameraIdx,
const cv::Mat &  image 
)
inline

Set the frame image;.

Parameters
[in]cameraIdxThe camera index that took the image.
[in]imageThe image.
bool okvis::MultiFrame::setLandmarkId ( size_t  cameraIdx,
size_t  keypointIdx,
uint64_t  landmarkId 
)
inline

Set the landmark ID.

Parameters
[in]cameraIdxThe camera index.
[in]keypointIdxThe requested keypoint's index.
[in]landmarkIdThe landmark Id.
Returns
whether or not the operation was successful.
void okvis::MultiFrame::setTimestamp ( const okvis::Time timestamp)
inline

(Re)set the timestamp

Parameters
[in]timestampThe time this frame was recorded.
std::shared_ptr< const okvis::kinematics::Transformation > okvis::MultiFrame::T_SC ( size_t  cameraIdx) const
inline

Get the extrinsics of a camera.

Parameters
[in]cameraIdxThe camera index for which the extrinsics are queried.
Returns
The extrinsics as T_SC.
const okvis::Time & okvis::MultiFrame::timestamp ( ) const
inline

Obtain the frame timestamp.

Returns
The time this frame was recorded.

Member Data Documentation

cameras::NCameraSystem okvis::MultiFrame::cameraSystem_
protected

the camera system

std::vector<Frame, Eigen::aligned_allocator<Frame> > okvis::MultiFrame::frames_
protected

the individual frames

uint64_t okvis::MultiFrame::id_
protected

the frame id

okvis::Time okvis::MultiFrame::timestamp_
protected

the frame timestamp


The documentation for this class was generated from the following file: