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

Merge pull request #20367 from augustinmanecy:features2d-rw

**Merge with contrib**: https://github.com/opencv/opencv_contrib/pull/3003

### Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
- [x] The PR is proposed to proper branch
- [ ] There is reference to original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
      Patch to opencv_extra has the same branch name.
- [ ] The feature is well documented and sample code can be built with the project CMake
This commit is contained in:
augustinmanecy
2022-12-21 14:03:00 +01:00
committed by GitHub
parent 63b6b24cd0
commit 0bd54a60e9
28 changed files with 845 additions and 555 deletions
+60
View File
@@ -87,6 +87,48 @@ public:
virtual ~MSER_Impl() CV_OVERRIDE {}
void read( const FileNode& fn) CV_OVERRIDE
{
// if node is empty, keep previous value
if (!fn["delta"].empty())
fn["delta"] >> params.delta;
if (!fn["minArea"].empty())
fn["minArea"] >> params.minArea;
if (!fn["maxArea"].empty())
fn["maxArea"] >> params.maxArea;
if (!fn["maxVariation"].empty())
fn["maxVariation"] >> params.maxVariation;
if (!fn["minDiversity"].empty())
fn["minDiversity"] >> params.minDiversity;
if (!fn["maxEvolution"].empty())
fn["maxEvolution"] >> params.maxEvolution;
if (!fn["areaThreshold"].empty())
fn["areaThreshold"] >> params.areaThreshold;
if (!fn["minMargin"].empty())
fn["minMargin"] >> params.minMargin;
if (!fn["edgeBlurSize"].empty())
fn["edgeBlurSize"] >> params.edgeBlurSize;
if (!fn["pass2Only"].empty())
fn["pass2Only"] >> params.pass2Only;
}
void write( FileStorage& fs) const CV_OVERRIDE
{
if(fs.isOpened())
{
fs << "name" << getDefaultName();
fs << "delta" << params.delta;
fs << "minArea" << params.minArea;
fs << "maxArea" << params.maxArea;
fs << "maxVariation" << params.maxVariation;
fs << "minDiversity" << params.minDiversity;
fs << "maxEvolution" << params.maxEvolution;
fs << "areaThreshold" << params.areaThreshold;
fs << "minMargin" << params.minMargin;
fs << "edgeBlurSize" << params.edgeBlurSize;
fs << "pass2Only" << params.pass2Only;
}
}
void setDelta(int delta) CV_OVERRIDE { params.delta = delta; }
int getDelta() const CV_OVERRIDE { return params.delta; }
@@ -96,6 +138,24 @@ public:
void setMaxArea(int maxArea) CV_OVERRIDE { params.maxArea = maxArea; }
int getMaxArea() const CV_OVERRIDE { return params.maxArea; }
void setMaxVariation(double maxVariation) CV_OVERRIDE { params.maxVariation = maxVariation; }
double getMaxVariation() const CV_OVERRIDE { return params.maxVariation; }
void setMinDiversity(double minDiversity) CV_OVERRIDE { params.minDiversity = minDiversity; }
double getMinDiversity() const CV_OVERRIDE { return params.minDiversity; }
void setMaxEvolution(int maxEvolution) CV_OVERRIDE { params.maxEvolution = maxEvolution; }
int getMaxEvolution() const CV_OVERRIDE { return params.maxEvolution; }
void setAreaThreshold(double areaThreshold) CV_OVERRIDE { params.areaThreshold = areaThreshold; }
double getAreaThreshold() const CV_OVERRIDE { return params.areaThreshold; }
void setMinMargin(double min_margin) CV_OVERRIDE { params.minMargin = min_margin; }
double getMinMargin() const CV_OVERRIDE { return params.minMargin; }
void setEdgeBlurSize(int edge_blur_size) CV_OVERRIDE { params.edgeBlurSize = edge_blur_size; }
int getEdgeBlurSize() const CV_OVERRIDE { return params.edgeBlurSize; }
void setPass2Only(bool f) CV_OVERRIDE { params.pass2Only = f; }
bool getPass2Only() const CV_OVERRIDE { return params.pass2Only; }