Autonomous Space Robotics Lab

Speeded Up SURF

UTIAS ASRL

asrl::GpuSurfDetector Class Reference

The exported class representing the GPU surf detector. More...

#include <GpuSurfDetector.hpp>

List of all members.

Public Member Functions

GPUSURF_API GpuSurfDetector (GpuSurfConfiguration config=GpuSurfConfiguration())
virtual GPUSURF_API ~GpuSurfDetector ()
GPUSURF_API void buildIntegralImage (cv::Mat &image)
GPUSURF_API void detectKeypoints ()
GPUSURF_API void findOrientation ()
GPUSURF_API void findOrientationFast ()
GPUSURF_API void computeDescriptors ()
GPUSURF_API void computeUprightDescriptors ()
GPUSURF_API void getKeypoints (std::vector< cv::KeyPoint > &outKeypoints)
GPUSURF_API void getDescriptors (std::vector< float > &outDescriptors)
GPUSURF_API int descriptorSize ()
GPUSURF_API void setKeypoints (std::vector< cv::KeyPoint > const &inKeypoints)
GPUSURF_API void saveIntegralImage (std::string const &basename)

Private Member Functions

 GpuSurfDetector (const GpuSurfDetector &rhs)
 The detector is non-copyable. Declare a private copy constructor.
GpuSurfDetectoroperator= (const GpuSurfDetector &rhs)

Private Attributes

GpuSurfDetectorInternalm_implementation
 The private implementation idiom hides the cuda headers from the class consumer.

Detailed Description

The exported class representing the GPU surf detector.

This class is the main entry point for high-level use of the gpusurf library. The class has been designed in an RAII style and uses the "Private Implementation" idiom to shield end users from having to find cuda headers A complete example of how to use this class is given in the file gpusurf_engine.cpp, but a simple example will be given below:

 #include <gpusurf/GpuSurfDetector.hpp>
 
 using namespace asrl;

 // Use the OpenCV library to load an 8-bit, grayscale image.
 cv::Mat image = cv::imread(imageFilename,CV_LOAD_IMAGE_GRAYSCALE);
 
 // Create the configuration object with all default values
 GpuSurfConfiguration config;

 // Create a detector initialized with the configuration
 GpuSurfDetector detector(config);

 // Run each step of the SURF algorithm.
 detector.buildIntegralImage(image);
 detector.detectKeypoints();

 // At this point, it is possible to grab the keypoints if descriptors or orientation are not needed.

 detector.findOrientation();
 detector.computeDescriptors();

 // Retrieve the keypoints from the GPU.
 std::vector<cv::KeyPoint> keypoints;
 detector.getKeypoints(keypoints)

 // Retrieve the descriptors from the GPU
 std::vector<float> descriptors
 detector.getDescriptors(descriptors);

The library can also be used to create descriptors for existing keypoints:

 #include <gpusurf/GpuSurfDetector.hpp>
 using namespace asrl;

 // Create a vector of keypoints
 std::vector<cv::KeyPoint> keypoints;
 
 // Fill the vector somehow...

 // Push the keypoints on to the device
 detector.setKeypoints(keypoints);

 // Now we can run the description parts of the SURF algorithm
 detector.findOrientation();
 detector.computeDescriptors();

 // Retrieve the keypoints from the GPU.
 detector.getKeypoints(keypoints)

 // Retrieve the descriptors from the GPU
 std::vector<float> descriptors
 detector.getDescriptors(descriptors);

Definition at line 205 of file GpuSurfDetector.hpp.


Constructor & Destructor Documentation

asrl::GpuSurfDetector::GpuSurfDetector ( GpuSurfConfiguration  config = GpuSurfConfiguration()  ) 

A constructor that takes a configuration object

Parameters:
config The configuration object

Definition at line 37 of file GpuSurfDetector.cpp.

asrl::GpuSurfDetector::~GpuSurfDetector (  )  [virtual]

The destructor

Definition at line 43 of file GpuSurfDetector.cpp.

asrl::GpuSurfDetector::GpuSurfDetector ( const GpuSurfDetector rhs  )  [private]

The detector is non-copyable. Declare a private copy constructor.


Member Function Documentation

void asrl::GpuSurfDetector::buildIntegralImage ( cv::Mat &  image  ) 

The first step in the surf pipeline. This builds an integral image from the image argument Only densly packed images images of type CV_8UC1 are supported.

Parameters:
image The image used to create the integral image.

Definition at line 49 of file GpuSurfDetector.cpp.

void asrl::GpuSurfDetector::computeDescriptors (  ) 

This computes a descriptor for each keypoint on the GPU

Definition at line 69 of file GpuSurfDetector.cpp.

void asrl::GpuSurfDetector::computeUprightDescriptors (  ) 

This computes an upright (not rotation invariant) descriptor for each keypoint on the GPU

Definition at line 74 of file GpuSurfDetector.cpp.

int asrl::GpuSurfDetector::descriptorSize (  ) 

The descriptor size

Returns:

Definition at line 99 of file GpuSurfDetector.cpp.

void asrl::GpuSurfDetector::detectKeypoints (  ) 

The second step in the SURF pipeline. This detects keypoints using the fast hessian algorithm

Definition at line 54 of file GpuSurfDetector.cpp.

void asrl::GpuSurfDetector::findOrientation (  ) 

This computes an orientation for all keypoints currently on the GPU

Definition at line 59 of file GpuSurfDetector.cpp.

void asrl::GpuSurfDetector::findOrientationFast (  ) 

This computes an orientation for all keypoints currently on the GPU This computation is slightly faster than the one described in the SURF paper

Definition at line 64 of file GpuSurfDetector.cpp.

void asrl::GpuSurfDetector::getDescriptors ( std::vector< float > &  outDescriptors  ) 

This downloads the keypoint descriptors from the GPU and packs them into the vector

Parameters:
outKeypoints The vector of keypoint descriptors found. This buffer is N x descriptorSize() where N is the number of keypoints returned by getKeypoints().

Definition at line 94 of file GpuSurfDetector.cpp.

void asrl::GpuSurfDetector::getKeypoints ( std::vector< cv::KeyPoint > &  outKeypoints  ) 

This downloads the keypoints from the GPU and packs them into the vector

Parameters:
outKeypoints The vector of keypoints found.

Definition at line 79 of file GpuSurfDetector.cpp.

GpuSurfDetector& asrl::GpuSurfDetector::operator= ( const GpuSurfDetector rhs  )  [private]

The detector is non-copyable. Declare a private operator=()

void asrl::GpuSurfDetector::saveIntegralImage ( std::string const &  basename  ) 

This saves the integral image to disk

Parameters:
basename The base fileame. The integral image will be saved as basename-iimg.bin

Definition at line 89 of file GpuSurfDetector.cpp.

void asrl::GpuSurfDetector::setKeypoints ( std::vector< cv::KeyPoint > const &  inKeypoints  ) 

This pushes keypoints on to the GPU.

Parameters:
inKeypoints The keypoints to be pushed on to the GPU

Definition at line 84 of file GpuSurfDetector.cpp.


Member Data Documentation

The private implementation idiom hides the cuda headers from the class consumer.

Definition at line 309 of file GpuSurfDetector.hpp.


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

Generated on Fri Apr 30 20:06:20 2010 for gpusurf by doxygen 1.6.2