|
@@ -4,13 +4,13 @@
|
|
* @author Erik Rodner
|
|
* @author Erik Rodner
|
|
* @date 03/10/2012 (Eric Bach)
|
|
* @date 03/10/2012 (Eric Bach)
|
|
* @note some notes to the use of siftGPU (added by Eric Bach)
|
|
* @note some notes to the use of siftGPU (added by Eric Bach)
|
|
-* - install cudaSift & siftGPU (see Makefile.config)
|
|
|
|
-* - add to libdepend.inc: $(call PKG_DEPEND_EXT, CUDASIFT) to specify: -DNICE_USELIB_CUDASIFT as compilerflag
|
|
|
|
-* - add to section [LFSiftPP] use_siftgpu=true (or 'false' to disable the gpu-support)
|
|
|
|
-*
|
|
|
|
-* If you use the gpu-support just one device is supported until now.
|
|
|
|
-* If your device do not support the siftGPU completly the class switch to "normal" sift.
|
|
|
|
-* It is possible to compile this class without siftGPU, but then you must not specify the flag: -DNICE_USELIB_CUDASIFT.
|
|
|
|
|
|
+* - install cudaSift & siftGPU (see Makefile.config)
|
|
|
|
+* - add to libdepend.inc: $(call PKG_DEPEND_EXT, CUDASIFT) to specify: -DNICE_USELIB_CUDASIFT as compilerflag
|
|
|
|
+* - add to section [LFSiftPP] use_siftgpu=true (or 'false' to disable the gpu-support)
|
|
|
|
+*
|
|
|
|
+* If you use the gpu-support just one device is supported until now.
|
|
|
|
+* If your device do not support the siftGPU completly the class switch to "normal" sift.
|
|
|
|
+* It is possible to compile this class without siftGPU, but then you must not specify the flag: -DNICE_USELIB_CUDASIFT.
|
|
*/
|
|
*/
|
|
#ifndef LOCALFEATURESIFTINCLUDE
|
|
#ifndef LOCALFEATURESIFTINCLUDE
|
|
#define LOCALFEATURESIFTINCLUDE
|
|
#define LOCALFEATURESIFTINCLUDE
|
|
@@ -32,8 +32,8 @@
|
|
|
|
|
|
// SiftGPU & GL
|
|
// SiftGPU & GL
|
|
#ifdef NICE_USELIB_CUDASIFT
|
|
#ifdef NICE_USELIB_CUDASIFT
|
|
- #include <src/SiftGPU.h>
|
|
|
|
- #include <GL/gl.h>
|
|
|
|
|
|
+#include <src/SiftGPU.h>
|
|
|
|
+#include <GL/gl.h>
|
|
#endif
|
|
#endif
|
|
|
|
|
|
|
|
|
|
@@ -42,10 +42,10 @@ namespace OBJREC {
|
|
/** local feature with sift */
|
|
/** local feature with sift */
|
|
class LocalFeatureSift : public LocalFeature
|
|
class LocalFeatureSift : public LocalFeature
|
|
{
|
|
{
|
|
-private:
|
|
|
|
|
|
+ private:
|
|
const NICE::Config* conf;
|
|
const NICE::Config* conf;
|
|
|
|
|
|
-protected:
|
|
|
|
|
|
+ protected:
|
|
int octaves;
|
|
int octaves;
|
|
int levels;
|
|
int levels;
|
|
bool normalizeFeature;
|
|
bool normalizeFeature;
|
|
@@ -60,12 +60,12 @@ protected:
|
|
float threshold;
|
|
float threshold;
|
|
float edgeThreshold;
|
|
float edgeThreshold;
|
|
|
|
|
|
- void withPP( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors ) const;
|
|
|
|
|
|
+ void withPP ( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors ) const;
|
|
#ifdef NICE_USELIB_CUDASIFT
|
|
#ifdef NICE_USELIB_CUDASIFT
|
|
- void withGPU( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors ) const;
|
|
|
|
|
|
+ void withGPU ( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors ) const;
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-public:
|
|
|
|
|
|
+ public:
|
|
|
|
|
|
/** simple constructor */
|
|
/** simple constructor */
|
|
LocalFeatureSift ( const NICE::Config *conf );
|
|
LocalFeatureSift ( const NICE::Config *conf );
|
|
@@ -79,16 +79,16 @@ public:
|
|
* @return 128
|
|
* @return 128
|
|
*/
|
|
*/
|
|
int getDescSize() const {
|
|
int getDescSize() const {
|
|
- return 128;
|
|
|
|
|
|
+ return 128;
|
|
};
|
|
};
|
|
|
|
|
|
|
|
|
|
//! returns true if gpu is used
|
|
//! returns true if gpu is used
|
|
bool isGpuUsed() const {
|
|
bool isGpuUsed() const {
|
|
#ifdef NICE_USELIB_CUDASIFT
|
|
#ifdef NICE_USELIB_CUDASIFT
|
|
- return usegpu;
|
|
|
|
|
|
+ return usegpu;
|
|
#else
|
|
#else
|
|
- return false;
|
|
|
|
|
|
+ return false;
|
|
#endif
|
|
#endif
|
|
};
|
|
};
|
|
|
|
|
|
@@ -109,13 +109,13 @@ public:
|
|
* @param positions
|
|
* @param positions
|
|
* @param descriptors
|
|
* @param descriptors
|
|
*/
|
|
*/
|
|
- void computeDesc( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors ) const;
|
|
|
|
|
|
+ void computeDesc ( const NICE::Image & img, NICE::VVector & positions, NICE::VVector & descriptors ) const;
|
|
|
|
|
|
/**
|
|
/**
|
|
* sort positions by scales for faster computing of the Keypoint orientation
|
|
* sort positions by scales for faster computing of the Keypoint orientation
|
|
* @param positions
|
|
* @param positions
|
|
*/
|
|
*/
|
|
- void sortPositions(NICE::VVector & positions) const;
|
|
|
|
|
|
+ void sortPositions ( NICE::VVector & positions ) const;
|
|
|
|
|
|
void visualizeFeatures ( NICE::Image & mark, const NICE::VVector & positions, size_t color ) const;
|
|
void visualizeFeatures ( NICE::Image & mark, const NICE::VVector & positions, size_t color ) const;
|
|
|
|
|