/* This file is part of RGBDSLAM.
*
* RGBDSLAM is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RGBDSLAM is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RGBDSLAM. If not, see .
*/
#ifndef SIFT_GPU_FEATURE_DETECTOR_H
#define SIFT_GPU_FEATURE_DETECTOR_H
//#ifdef USE_SIFT_GPU
#include
#include
#include
/*!
* \brief Interface for SiftGPU
* The class is used as an interface to SiftGPU.
* It's a singleton class
*/
class SiftGPUFeatureDetector {
public:
/*!
* Destructor
*/
virtual ~SiftGPUFeatureDetector();
/*!
* Main method, which is used for calculating the features and descriptors.
* The first parameter is the image, the second one a reference to a keypoint vector
* and the third parameter can be used for defining a mask
*
* \param image the image
* \param keypoints a cv::vector of cv::Keypoints, which is used for storing the keypoints
* \param mask a mask (see OpenCV)
* \return a pointer to the descriptor values
*/
float* detect( const cv::Mat& image, cv::vector& keypoints, const cv::Mat& mask = cv::Mat()) const;
/*!
* Return instance of the singleton class
*/
static SiftGPUFeatureDetector* GetInstance();
static void DestroyInstance();
private:
/*!
* private constructor, because of singleton
*/
SiftGPUFeatureDetector();
/*!
* Building a siftgpu compatible unsigned char pointer out of the image cv::Mat
* (converts a cv matrix into an OpenGL texture array)
*
* \param image the image
* \param siftImage the transformed image (output)
*/
void CVMatToSiftGPU(const cv::Mat& image, unsigned char* siftImage) const;
/*!
* For testing purposes: write a .pgm file of the SiftGPU image
*
* \param fp a filepointer
* \param data the imagedata (e.g. OpenGL texture)
* \param width width
* \param height height
*/
void WritePGM(FILE *fp, unsigned char* data, int width, int height);
static const int imageWidth = 640; ///