mirror of
https://github.com/opencv/opencv.git
synced 2025-06-09 10:40:46 +08:00
Avoid multi-inheritance in the cuda::features2d classes
This commit is contained in:
parent
94758c18de
commit
db262fa76a
@ -374,7 +374,7 @@ public:
|
|||||||
|
|
||||||
/** @brief Abstract base class for CUDA asynchronous 2D image feature detectors and descriptor extractors.
|
/** @brief Abstract base class for CUDA asynchronous 2D image feature detectors and descriptor extractors.
|
||||||
*/
|
*/
|
||||||
class CV_EXPORTS Feature2DAsync
|
class CV_EXPORTS Feature2DAsync : public cv::Feature2D
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual ~Feature2DAsync();
|
virtual ~Feature2DAsync();
|
||||||
@ -423,7 +423,7 @@ public:
|
|||||||
|
|
||||||
/** @brief Wrapping class for feature detection using the FAST method.
|
/** @brief Wrapping class for feature detection using the FAST method.
|
||||||
*/
|
*/
|
||||||
class CV_EXPORTS FastFeatureDetector : public cv::FastFeatureDetector, public Feature2DAsync
|
class CV_EXPORTS FastFeatureDetector : public Feature2DAsync
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum
|
enum
|
||||||
@ -437,8 +437,9 @@ public:
|
|||||||
|
|
||||||
static Ptr<FastFeatureDetector> create(int threshold=10,
|
static Ptr<FastFeatureDetector> create(int threshold=10,
|
||||||
bool nonmaxSuppression=true,
|
bool nonmaxSuppression=true,
|
||||||
int type=FastFeatureDetector::TYPE_9_16,
|
int type=cv::FastFeatureDetector::TYPE_9_16,
|
||||||
int max_npoints = 5000);
|
int max_npoints = 5000);
|
||||||
|
virtual void setThreshold(int threshold) = 0;
|
||||||
|
|
||||||
virtual void setMaxNumPoints(int max_npoints) = 0;
|
virtual void setMaxNumPoints(int max_npoints) = 0;
|
||||||
virtual int getMaxNumPoints() const = 0;
|
virtual int getMaxNumPoints() const = 0;
|
||||||
@ -452,7 +453,7 @@ public:
|
|||||||
*
|
*
|
||||||
* @sa cv::ORB
|
* @sa cv::ORB
|
||||||
*/
|
*/
|
||||||
class CV_EXPORTS ORB : public cv::ORB, public Feature2DAsync
|
class CV_EXPORTS ORB : public Feature2DAsync
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum
|
enum
|
||||||
@ -472,7 +473,7 @@ public:
|
|||||||
int edgeThreshold=31,
|
int edgeThreshold=31,
|
||||||
int firstLevel=0,
|
int firstLevel=0,
|
||||||
int WTA_K=2,
|
int WTA_K=2,
|
||||||
int scoreType=ORB::HARRIS_SCORE,
|
int scoreType=cv::ORB::HARRIS_SCORE,
|
||||||
int patchSize=31,
|
int patchSize=31,
|
||||||
int fastThreshold=20,
|
int fastThreshold=20,
|
||||||
bool blurForDescriptor=false);
|
bool blurForDescriptor=false);
|
||||||
|
@ -81,8 +81,8 @@ namespace
|
|||||||
virtual void setMaxNumPoints(int max_npoints) { max_npoints_ = max_npoints; }
|
virtual void setMaxNumPoints(int max_npoints) { max_npoints_ = max_npoints; }
|
||||||
virtual int getMaxNumPoints() const { return max_npoints_; }
|
virtual int getMaxNumPoints() const { return max_npoints_; }
|
||||||
|
|
||||||
virtual void setType(int type) { CV_Assert( type == TYPE_9_16 ); }
|
virtual void setType(int type) { CV_Assert( type == cv::FastFeatureDetector::TYPE_9_16 ); }
|
||||||
virtual int getType() const { return TYPE_9_16; }
|
virtual int getType() const { return cv::FastFeatureDetector::TYPE_9_16; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int threshold_;
|
int threshold_;
|
||||||
@ -207,7 +207,7 @@ namespace
|
|||||||
|
|
||||||
Ptr<cv::cuda::FastFeatureDetector> cv::cuda::FastFeatureDetector::create(int threshold, bool nonmaxSuppression, int type, int max_npoints)
|
Ptr<cv::cuda::FastFeatureDetector> cv::cuda::FastFeatureDetector::create(int threshold, bool nonmaxSuppression, int type, int max_npoints)
|
||||||
{
|
{
|
||||||
CV_Assert( type == TYPE_9_16 );
|
CV_Assert( type == cv::FastFeatureDetector::TYPE_9_16 );
|
||||||
return makePtr<FAST_Impl>(threshold, nonmaxSuppression, max_npoints);
|
return makePtr<FAST_Impl>(threshold, nonmaxSuppression, max_npoints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +354,7 @@ namespace
|
|||||||
|
|
||||||
virtual void convert(InputArray _gpu_keypoints, std::vector<KeyPoint>& keypoints);
|
virtual void convert(InputArray _gpu_keypoints, std::vector<KeyPoint>& keypoints);
|
||||||
|
|
||||||
virtual int descriptorSize() const { return kBytes; }
|
virtual int descriptorSize() const { return cv::ORB::kBytes; }
|
||||||
virtual int descriptorType() const { return CV_8U; }
|
virtual int descriptorType() const { return CV_8U; }
|
||||||
virtual int defaultNorm() const { return NORM_HAMMING; }
|
virtual int defaultNorm() const { return NORM_HAMMING; }
|
||||||
|
|
||||||
@ -764,7 +764,7 @@ namespace
|
|||||||
|
|
||||||
const int n_features = static_cast<int>(n_features_per_level_[level]);
|
const int n_features = static_cast<int>(n_features_per_level_[level]);
|
||||||
|
|
||||||
if (scoreType_ == ORB::HARRIS_SCORE)
|
if (scoreType_ == cv::ORB::HARRIS_SCORE)
|
||||||
{
|
{
|
||||||
// Keep more points than necessary as FAST does not give amazing corners
|
// Keep more points than necessary as FAST does not give amazing corners
|
||||||
cull(keyPointsPyr_[level], keyPointsCount_[level], 2 * n_features, stream);
|
cull(keyPointsPyr_[level], keyPointsCount_[level], 2 * n_features, stream);
|
||||||
|
Loading…
Reference in New Issue
Block a user