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

A single camera frame equipped with keypoint detector / extractor. More...

#include <Frame.hpp>

Public Member Functions

EIGEN_MAKE_ALIGNED_OPERATOR_NEW Frame ()
 a default constructor More...
 
 Frame (const cv::Mat &image, std::shared_ptr< cameras::CameraBase > &cameraGeometry, std::shared_ptr< cv::FeatureDetector > &detector, std::shared_ptr< cv::DescriptorExtractor > &extractor)
 A constructor that uses the image, specified geometry, detector and extractor. More...
 
virtual ~Frame ()
 A simple destructor. More...
 
void setImage (const cv::Mat &image)
 Set the frame image;. More...
 
void setGeometry (std::shared_ptr< const cameras::CameraBase > cameraGeometry)
 Set the geometry. More...
 
void setDetector (std::shared_ptr< cv::FeatureDetector > detector)
 Set the detector. More...
 
void setExtractor (std::shared_ptr< cv::DescriptorExtractor > extractor)
 Set the extractor. More...
 
const cv::Mat & image () const
 Obtain the image. More...
 
std::shared_ptr< const
cameras::CameraBase
geometry () const
 get the base class geometry (will be slow to use) More...
 
template<class GEOMETRY_T >
std::shared_ptr< const GEOMETRY_T > geometryAs () const
 Get the specific geometry (will be fast to use) More...
 
int detect ()
 Detect keypoints. This uses virtual function calls. That's a negligibly small overhead for many detections. More...
 
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 detections. More...
 
template<class GEOMETRY_T >
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 detections. More...
 
bool getCvKeypoint (size_t keypointIdx, cv::KeyPoint &keypoint) const
 Access a specific keypoint in OpenCV format. More...
 
bool getKeypoint (size_t keypointIdx, Eigen::Vector2d &keypoint) const
 Get a specific keypoint. More...
 
bool getKeypointSize (size_t keypointIdx, double &keypointSize) const
 Get the size of a specific keypoint. More...
 
const unsigned char * keypointDescriptor (size_t keypointIdx)
 Access the descriptor – CAUTION: high-speed version. More...
 
bool setLandmarkId (size_t keypointIdx, uint64_t landmarkId)
 Set the landmark ID. More...
 
uint64_t landmarkId (size_t keypointIdx) const
 Access the landmark ID. More...
 
bool resetKeypoints (const std::vector< cv::KeyPoint > &keypoints)
 Provide keypoints externally. More...
 
bool resetDescriptors (const cv::Mat &descriptors)
 provide descriptors externally More...
 
size_t numKeypoints () const
 Get the number of keypoints. More...
 

Protected Attributes

cv::Mat image_
 the image as OpenCV's matrix More...
 
std::shared_ptr< const
cameras::CameraBase
cameraGeometry_
 the camera geometry More...
 
std::shared_ptr
< cv::FeatureDetector > 
detector_
 the detector More...
 
std::shared_ptr
< cv::DescriptorExtractor > 
extractor_
 the extractor More...
 
std::vector< cv::KeyPoint > keypoints_
 we store keypoints using OpenCV's struct More...
 
cv::Mat descriptors_
 we store the descriptors using OpenCV's matrices More...
 
std::vector< uint64_t > landmarkIds_
 landmark Id, if associated – 0 otherwise More...
 

Detailed Description

A single camera frame equipped with keypoint detector / extractor.

Constructor & Destructor Documentation

EIGEN_MAKE_ALIGNED_OPERATOR_NEW okvis::Frame::Frame ( )
inline

a default constructor

okvis::Frame::Frame ( const cv::Mat &  image,
std::shared_ptr< cameras::CameraBase > &  cameraGeometry,
std::shared_ptr< cv::FeatureDetector > &  detector,
std::shared_ptr< cv::DescriptorExtractor > &  extractor 
)
inline

A constructor that uses the image, specified geometry, detector and extractor.

detector and extractor

Parameters
[in]imageThe image.
[in]cameraGeometryThe camera geometry.
[in]detectorThe detector to be used.
[in]extractorThe extractor to be used.
virtual okvis::Frame::~Frame ( )
inlinevirtual

A simple destructor.

Member Function Documentation

int okvis::Frame::describe ( 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
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::Frame::describeAs ( 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
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.
int okvis::Frame::detect ( )
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::Frame::geometry ( ) const
inline

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

Returns
The camera geometry.
template<class GEOMETRY_T >
std::shared_ptr< const GEOMETRY_T > okvis::Frame::geometryAs ( ) const
inline

Get the specific geometry (will be fast to use)

Template Parameters
GEOMETRY_TThe type for the camera geometry requested.
Returns
The camera geometry.
bool okvis::Frame::getCvKeypoint ( size_t  keypointIdx,
cv::KeyPoint &  keypoint 
) const
inline

Access a specific keypoint in OpenCV format.

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

Get a specific keypoint.

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

Get the size of a specific keypoint.

Parameters
[in]keypointIdxThe requested keypoint's index.
[out]keypointSizeThe requested keypoint's size.
Returns
whether or not the operation was successful.
const cv::Mat & okvis::Frame::image ( ) const
inline

Obtain the image.

Returns
The image.
const unsigned char * okvis::Frame::keypointDescriptor ( size_t  keypointIdx)
inline

Access the descriptor – CAUTION: high-speed version.

returns NULL if out of bounds.

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

Access the landmark ID.

Parameters
[in]keypointIdxThe requested keypoint's index.
Returns
The landmark Id.
size_t okvis::Frame::numKeypoints ( ) const
inline

Get the number of keypoints.

Returns
The number of keypoints.
bool okvis::Frame::resetDescriptors ( const cv::Mat &  descriptors)
inline

provide descriptors externally

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

Provide keypoints externally.

Parameters
[in]keypointsA vector of keyoints.
Returns
whether or not the operation was successful.
void okvis::Frame::setDetector ( std::shared_ptr< cv::FeatureDetector >  detector)
inline

Set the detector.

Parameters
[in]detectorThe detector to be used.
void okvis::Frame::setExtractor ( std::shared_ptr< cv::DescriptorExtractor >  extractor)
inline

Set the extractor.

Parameters
[in]extractorThe extractor to be used.
void okvis::Frame::setGeometry ( std::shared_ptr< const cameras::CameraBase cameraGeometry)
inline

Set the geometry.

Parameters
[in]cameraGeometryThe camera geometry.
void okvis::Frame::setImage ( const cv::Mat &  image)
inline

Set the frame image;.

Parameters
[in]imageThe image.
bool okvis::Frame::setLandmarkId ( size_t  keypointIdx,
uint64_t  landmarkId 
)
inline

Set the landmark ID.

Parameters
[in]keypointIdxThe requested keypoint's index.
[in]landmarkIdThe landmark Id.
Returns
whether or not the operation was successful.

Member Data Documentation

std::shared_ptr<const cameras::CameraBase> okvis::Frame::cameraGeometry_
protected

the camera geometry

cv::Mat okvis::Frame::descriptors_
protected

we store the descriptors using OpenCV's matrices

std::shared_ptr<cv::FeatureDetector> okvis::Frame::detector_
protected

the detector

std::shared_ptr<cv::DescriptorExtractor> okvis::Frame::extractor_
protected

the extractor

cv::Mat okvis::Frame::image_
protected

the image as OpenCV's matrix

std::vector<cv::KeyPoint> okvis::Frame::keypoints_
protected

we store keypoints using OpenCV's struct

std::vector<uint64_t> okvis::Frame::landmarkIds_
protected

landmark Id, if associated – 0 otherwise


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