Extend the interface of the ORB class

pull/3244/head
huangziqing 3 years ago
parent f6a39c5d01
commit 4c76620299
  1. 30
      modules/cudafeatures2d/include/opencv2/cudafeatures2d.hpp
  2. 12
      modules/cudafeatures2d/misc/python/test/test_cudafeatures2d.py
  3. 4
      modules/cudafeatures2d/src/orb.cpp

@ -471,12 +471,36 @@ public:
int fastThreshold=20,
bool blurForDescriptor=false);
//! if true, image will be blurred before descriptors calculation
CV_WRAP virtual void setBlurForDescriptor(bool blurForDescriptor) = 0;
CV_WRAP virtual bool getBlurForDescriptor() const = 0;
CV_WRAP virtual void setMaxFeatures(int maxFeatures) = 0;
CV_WRAP virtual int getMaxFeatures() const = 0;
CV_WRAP virtual void setScaleFactor(double scaleFactor) = 0;
CV_WRAP virtual double getScaleFactor() const = 0;
CV_WRAP virtual void setNLevels(int nlevels) = 0;
CV_WRAP virtual int getNLevels() const = 0;
CV_WRAP virtual void setEdgeThreshold(int edgeThreshold) = 0;
CV_WRAP virtual int getEdgeThreshold() const = 0;
CV_WRAP virtual void setFirstLevel(int firstLevel) = 0;
CV_WRAP virtual int getFirstLevel() const = 0;
CV_WRAP virtual void setWTA_K(int wta_k) = 0;
CV_WRAP virtual int getWTA_K() const = 0;
CV_WRAP virtual void setScoreType(int scoreType) = 0;
CV_WRAP virtual int getScoreType() const = 0;
CV_WRAP virtual void setPatchSize(int patchSize) = 0;
CV_WRAP virtual int getPatchSize() const = 0;
CV_WRAP virtual void setFastThreshold(int fastThreshold) = 0;
CV_WRAP virtual int getFastThreshold() const = 0;
//! if true, image will be blurred before descriptors calculation
CV_WRAP virtual void setBlurForDescriptor(bool blurForDescriptor) = 0;
CV_WRAP virtual bool getBlurForDescriptor() const = 0;
};
//! @}

@ -27,6 +27,18 @@ class cudafeatures2d_test(NewOpenCVTests):
_kps = fast.detectAsync(cuMat1)
orb = cv.cuda_ORB.create()
orb.setMaxFeatures(500)
orb.setScaleFactor(1.2)
orb.setNLevels(8)
orb.setEdgeThreshold(31)
orb.setFirstLevel(0)
orb.setWTA_K(2)
orb.setScoreType(cv.ORB_HARRIS_SCORE)
orb.setPatchSize(31)
orb.setFastThreshold(20)
orb.setBlurForDescriptor(True)
_kps1, descs1 = orb.detectAndComputeAsync(cuMat1, None)
_kps2, descs2 = orb.detectAndComputeAsync(cuMat2, None)

@ -373,13 +373,13 @@ namespace
virtual void setFirstLevel(int firstLevel) { firstLevel_ = firstLevel; }
virtual int getFirstLevel() const { return firstLevel_; }
virtual void setWTA_K(int wta_k) { WTA_K_ = wta_k; }
virtual void setWTA_K(int wta_k) { CV_Assert( wta_k == 2 || wta_k == 3 || wta_k == 4 ); WTA_K_ = wta_k; }
virtual int getWTA_K() const { return WTA_K_; }
virtual void setScoreType(int scoreType) { scoreType_ = scoreType; }
virtual int getScoreType() const { return scoreType_; }
virtual void setPatchSize(int patchSize) { patchSize_ = patchSize; }
virtual void setPatchSize(int patchSize) { CV_Assert( patchSize >= 2 ); patchSize_ = patchSize; }
virtual int getPatchSize() const { return patchSize_; }
virtual void setFastThreshold(int fastThreshold) { fastThreshold_ = fastThreshold; }

Loading…
Cancel
Save