lot's of changes; nonfree & photo modules added; SIFT & SURF -> nonfree module; Inpainting -> photo; refactored features2d (ORB is still failing tests), optimized brute-force matcher and made it non-template.

This commit is contained in:
Vadim Pisarevsky
2012-03-15 14:36:01 +00:00
parent 6300215b94
commit 957e80abbd
99 changed files with 6719 additions and 7240 deletions

View File

@@ -1511,7 +1511,7 @@ private:
////////////////////////////////// SURF //////////////////////////////////////////
class CV_EXPORTS SURF_GPU : public CvSURFParams
class CV_EXPORTS SURF_GPU
{
public:
enum KeypointLayout
@@ -1566,6 +1566,14 @@ public:
void releaseMemory();
// SURF parameters;
int extended;
int upright;
double hessianThreshold;
int nOctaves;
int nOctaveLayers;
//! max keypoints = min(keypointsRatio * img.size().area(), 65535)
float keypointsRatio;
@@ -1656,7 +1664,7 @@ public:
//! Constructor
//! n_features - the number of desired features
//! detector_params - parameters to use
explicit ORB_GPU(size_t n_features = 500, const ORB::CommonParams& detector_params = ORB::CommonParams());
explicit ORB_GPU(size_t n_features = 500, float scaleFactor = 1.2f, int nlevels = 3);
//! Compute the ORB features on an image
//! image - the image to compute the features (supports only CV_8UC1 images)
@@ -1682,7 +1690,7 @@ public:
//! returns the descriptor size in bytes
inline int descriptorSize() const { return kBytes; }
void setParams(size_t n_features, const ORB::CommonParams& detector_params);
void setParams(size_t n_features, float scaleFactor, int nlevels);
inline void setFastParams(int threshold, bool nonmaxSupression = true)
{
fastDetector_.threshold = threshold;
@@ -1706,7 +1714,7 @@ private:
void mergeKeyPoints(GpuMat& keypoints);
ORB::CommonParams params_;
ORB params_;
// The number of desired features per scale
std::vector<size_t> n_features_per_level_;

View File

@@ -48,14 +48,14 @@ using namespace cv::gpu;
#if !defined (HAVE_CUDA)
cv::gpu::ORB_GPU::ORB_GPU(size_t, const ORB::CommonParams&) : fastDetector_(0) { throw_nogpu(); }
cv::gpu::ORB_GPU::ORB_GPU(size_t, float, int) : fastDetector_(0) { throw_nogpu(); }
void cv::gpu::ORB_GPU::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&) { throw_nogpu(); }
void cv::gpu::ORB_GPU::operator()(const GpuMat&, const GpuMat&, GpuMat&) { throw_nogpu(); }
void cv::gpu::ORB_GPU::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&, GpuMat&) { throw_nogpu(); }
void cv::gpu::ORB_GPU::operator()(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&) { throw_nogpu(); }
void cv::gpu::ORB_GPU::downloadKeyPoints(GpuMat&, std::vector<KeyPoint>&) { throw_nogpu(); }
void cv::gpu::ORB_GPU::convertKeyPoints(Mat&, std::vector<KeyPoint>&) { throw_nogpu(); }
void cv::gpu::ORB_GPU::setParams(size_t, const ORB::CommonParams&) { throw_nogpu(); }
void cv::gpu::ORB_GPU::setParams(size_t, float, int) { throw_nogpu(); }
void cv::gpu::ORB_GPU::release() { throw_nogpu(); }
void cv::gpu::ORB_GPU::buildScalePyramids(const GpuMat&, const GpuMat&) { throw_nogpu(); }
void cv::gpu::ORB_GPU::computeKeyPointsPyramid() { throw_nogpu(); }
@@ -83,10 +83,10 @@ namespace cv { namespace gpu { namespace device
}
}}}
cv::gpu::ORB_GPU::ORB_GPU(size_t n_features, const ORB::CommonParams& detector_params) :
cv::gpu::ORB_GPU::ORB_GPU(size_t n_features, float scaleFactor, int nlevels) :
fastDetector_(DEFAULT_FAST_THRESHOLD)
{
setParams(n_features, detector_params);
setParams(n_features, scaleFactor, nlevels);
blurFilter = createGaussianFilter_GPU(CV_8UC1, Size(7, 7), 2, 2, BORDER_REFLECT_101);
@@ -407,9 +407,9 @@ namespace
}
}
void cv::gpu::ORB_GPU::setParams(size_t n_features, const ORB::CommonParams& detector_params)
void cv::gpu::ORB_GPU::setParams(size_t n_features, float scaleFactor, int nlevels)
{
params_ = detector_params;
params_ = ORB((int)n_features, scaleFactor, nlevels);
// fill the extractors and descriptors for the corresponding scales
int n_levels = static_cast<int>(params_.n_levels_);