1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

Merge pull request #12310 from cv3d:chunks/enum_interface

* Cleanup macros and enable expansion of `__VA_ARGS__` for Visual Studio

* Macros for enum-arguments backwards compatibility

* Convert struct Param to enum struct

* Enabled ParamType.type for enum types

* Enabled `cv.read` and `cv.write` for enum types

* Rename unnamed enum to AAKAZE.DescriptorType

* Rename unnamed enum to AccessFlag

* Rename unnamed enum to AgastFeatureDetector.DetectorType

* Convert struct DrawMatchesFlags to enum struct

* Rename unnamed enum to FastFeatureDetector.DetectorType

* Rename unnamed enum to Formatter.FormatType

* Rename unnamed enum to HOGDescriptor.HistogramNormType

* Rename unnamed enum to DescriptorMatcher.MatcherType

* Rename unnamed enum to KAZE.DiffusivityType

* Rename unnamed enum to ORB.ScoreType

* Rename unnamed enum to UMatData.MemoryFlag

* Rename unnamed enum to _InputArray.KindFlag

* Rename unnamed enum to _OutputArray.DepthMask

* Convert normType enums to static const NormTypes

* Avoid conflicts with ElemType

* Rename unnamed enum to DescriptorStorageFormat
This commit is contained in:
Hamdi Sahloul
2018-09-22 00:12:35 +09:00
committed by Alexander Alekhin
parent 84ae8097b1
commit ef5579dc86
51 changed files with 567 additions and 333 deletions
+10 -10
View File
@@ -415,7 +415,7 @@ static bool openvx_FAST(InputArray _img, std::vector<KeyPoint>& keypoints,
#endif
static inline int hal_FAST(cv::Mat& src, std::vector<KeyPoint>& keypoints, int threshold, bool nonmax_suppression, int type)
static inline int hal_FAST(cv::Mat& src, std::vector<KeyPoint>& keypoints, int threshold, bool nonmax_suppression, FastFeatureDetector::DetectorType type)
{
if (threshold > 20)
return CV_HAL_ERROR_NOT_IMPLEMENTED;
@@ -472,7 +472,7 @@ static inline int hal_FAST(cv::Mat& src, std::vector<KeyPoint>& keypoints, int t
return CV_HAL_ERROR_OK;
}
void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool nonmax_suppression, int type)
void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool nonmax_suppression, FastFeatureDetector::DetectorType type)
{
CV_INSTRUMENT_REGION();
@@ -514,8 +514,8 @@ void FAST(InputArray _img, std::vector<KeyPoint>& keypoints, int threshold, bool
class FastFeatureDetector_Impl CV_FINAL : public FastFeatureDetector
{
public:
FastFeatureDetector_Impl( int _threshold, bool _nonmaxSuppression, int _type )
: threshold(_threshold), nonmaxSuppression(_nonmaxSuppression), type((short)_type)
FastFeatureDetector_Impl( int _threshold, bool _nonmaxSuppression, FastFeatureDetector::DetectorType _type )
: threshold(_threshold), nonmaxSuppression(_nonmaxSuppression), type(_type)
{}
void detect( InputArray _image, std::vector<KeyPoint>& keypoints, InputArray _mask ) CV_OVERRIDE
@@ -548,7 +548,7 @@ public:
else if(prop == NONMAX_SUPPRESSION)
nonmaxSuppression = value != 0;
else if(prop == FAST_N)
type = cvRound(value);
type = static_cast<FastFeatureDetector::DetectorType>(cvRound(value));
else
CV_Error(Error::StsBadArg, "");
}
@@ -560,7 +560,7 @@ public:
if(prop == NONMAX_SUPPRESSION)
return nonmaxSuppression;
if(prop == FAST_N)
return type;
return static_cast<int>(type);
CV_Error(Error::StsBadArg, "");
return 0;
}
@@ -571,15 +571,15 @@ public:
void setNonmaxSuppression(bool f) CV_OVERRIDE { nonmaxSuppression = f; }
bool getNonmaxSuppression() const CV_OVERRIDE { return nonmaxSuppression; }
void setType(int type_) CV_OVERRIDE { type = type_; }
int getType() const CV_OVERRIDE { return type; }
void setType(FastFeatureDetector::DetectorType type_) CV_OVERRIDE{ type = type_; }
FastFeatureDetector::DetectorType getType() const CV_OVERRIDE{ return type; }
int threshold;
bool nonmaxSuppression;
int type;
FastFeatureDetector::DetectorType type;
};
Ptr<FastFeatureDetector> FastFeatureDetector::create( int threshold, bool nonmaxSuppression, int type )
Ptr<FastFeatureDetector> FastFeatureDetector::create( int threshold, bool nonmaxSuppression, FastFeatureDetector::DetectorType type )
{
return makePtr<FastFeatureDetector_Impl>(threshold, nonmaxSuppression, type);
}