|
|
|
@ -46,7 +46,7 @@ using namespace std; |
|
|
|
|
using namespace cv; |
|
|
|
|
using namespace cv::detail; |
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENCV_GPU |
|
|
|
|
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID) |
|
|
|
|
using namespace cv::gpu; |
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
@ -129,7 +129,7 @@ private: |
|
|
|
|
float match_conf_; |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENCV_GPU |
|
|
|
|
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID) |
|
|
|
|
class GpuMatcher : public FeaturesMatcher |
|
|
|
|
{ |
|
|
|
|
public: |
|
|
|
@ -204,7 +204,7 @@ void CpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &feat |
|
|
|
|
LOG("1->2 & 2->1 matches: " << matches_info.matches.size() << endl); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifdef HAVE_OPENCV_GPU |
|
|
|
|
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID) |
|
|
|
|
void GpuMatcher::match(const ImageFeatures &features1, const ImageFeatures &features2, MatchesInfo& matches_info) |
|
|
|
|
{ |
|
|
|
|
matches_info.matches.clear(); |
|
|
|
@ -432,7 +432,7 @@ void OrbFeaturesFinder::find(const Mat &image, ImageFeatures &features) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU) |
|
|
|
|
#if defined(HAVE_OPENCV_NONFREE) && defined(HAVE_OPENCV_GPU) && !defined(ANDROID) |
|
|
|
|
SurfFeaturesFinderGpu::SurfFeaturesFinderGpu(double hess_thresh, int num_octaves, int num_layers, |
|
|
|
|
int num_octaves_descr, int num_layers_descr) |
|
|
|
|
{ |
|
|
|
@ -533,7 +533,7 @@ void FeaturesMatcher::operator ()(const vector<ImageFeatures> &features, vector< |
|
|
|
|
|
|
|
|
|
BestOf2NearestMatcher::BestOf2NearestMatcher(bool try_use_gpu, float match_conf, int num_matches_thresh1, int num_matches_thresh2) |
|
|
|
|
{ |
|
|
|
|
#ifdef HAVE_OPENCV_GPU |
|
|
|
|
#if defined(HAVE_OPENCV_GPU) && !defined(ANDROID) |
|
|
|
|
if (try_use_gpu && getCudaEnabledDeviceCount() > 0) |
|
|
|
|
impl_ = new GpuMatcher(match_conf); |
|
|
|
|
else |
|
|
|
|