mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 03:33:28 +08:00
add nodiscard to features2d clone funcs
This commit is contained in:
parent
1e0d290f2e
commit
068f33cfdf
@ -1082,7 +1082,7 @@ public:
|
||||
that is, copies both parameters and train data. If emptyTrainData is true, the method creates an
|
||||
object copy with the current parameters but with empty train data.
|
||||
*/
|
||||
CV_WRAP virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const = 0;
|
||||
CV_WRAP CV_NODISCARD_STD virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const = 0;
|
||||
|
||||
/** @brief Creates a descriptor matcher of a given type with the default parameters (using default
|
||||
constructor).
|
||||
@ -1142,7 +1142,7 @@ protected:
|
||||
static bool isPossibleMatch( InputArray mask, int queryIdx, int trainIdx );
|
||||
static bool isMaskedOut( InputArrayOfArrays masks, int queryIdx );
|
||||
|
||||
static Mat clone_op( Mat m ) { return m.clone(); }
|
||||
CV_NODISCARD_STD static Mat clone_op( Mat m ) { return m.clone(); }
|
||||
void checkMasks( InputArrayOfArrays masks, int queryDescriptorsCount ) const;
|
||||
|
||||
//! Collection of descriptors from train images.
|
||||
@ -1183,7 +1183,7 @@ public:
|
||||
*/
|
||||
CV_WRAP static Ptr<BFMatcher> create( int normType=NORM_L2, bool crossCheck=false ) ;
|
||||
|
||||
virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const CV_OVERRIDE;
|
||||
CV_NODISCARD_STD virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const CV_OVERRIDE;
|
||||
protected:
|
||||
virtual void knnMatchImpl( InputArray queryDescriptors, std::vector<std::vector<DMatch> >& matches, int k,
|
||||
InputArrayOfArrays masks=noArray(), bool compactResult=false ) CV_OVERRIDE;
|
||||
@ -1222,7 +1222,7 @@ public:
|
||||
|
||||
CV_WRAP static Ptr<FlannBasedMatcher> create();
|
||||
|
||||
virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const CV_OVERRIDE;
|
||||
CV_NODISCARD_STD virtual Ptr<DescriptorMatcher> clone( bool emptyTrainData=false ) const CV_OVERRIDE;
|
||||
protected:
|
||||
static void convertToDMatches( const DescriptorCollection& descriptors,
|
||||
const Mat& indices, const Mat& distances,
|
||||
|
@ -432,11 +432,18 @@ class CppHeaderParser(object):
|
||||
# filter off some common prefixes, which are meaningless for Python wrappers.
|
||||
# note that we do not strip "static" prefix, which does matter;
|
||||
# it means class methods, not instance methods
|
||||
decl_str = self.batch_replace(decl_str, [("static inline", ""), ("inline", ""), ("explicit ", ""),
|
||||
("CV_EXPORTS_W", ""), ("CV_EXPORTS", ""), ("CV_CDECL", ""),
|
||||
("CV_WRAP ", " "), ("CV_INLINE", ""),
|
||||
("CV_DEPRECATED", ""), ("CV_DEPRECATED_EXTERNAL", "")]).strip()
|
||||
|
||||
decl_str = self.batch_replace(decl_str, [("static inline", ""),
|
||||
("inline", ""),
|
||||
("explicit ", ""),
|
||||
("CV_EXPORTS_W", ""),
|
||||
("CV_EXPORTS", ""),
|
||||
("CV_CDECL", ""),
|
||||
("CV_WRAP ", " "),
|
||||
("CV_INLINE", ""),
|
||||
("CV_DEPRECATED", ""),
|
||||
("CV_DEPRECATED_EXTERNAL", ""),
|
||||
("CV_NODISCARD_STD", ""),
|
||||
("CV_NODISCARD", "")]).strip()
|
||||
|
||||
if decl_str.strip().startswith('virtual'):
|
||||
virtual_method = True
|
||||
|
Loading…
Reference in New Issue
Block a user