Skip to content

Commit f572d15

Browse files
author
AleksandrPanov
committed
remove readWrite() from API
1 parent 059ade9 commit f572d15

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

modules/aruco/include/opencv2/aruco_detector.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,8 +280,6 @@ struct CV_EXPORTS_W RefineParameters {
280280
* If it set to false, only the provided corner order is considered (default true).
281281
*/
282282
CV_PROP_RW bool checkAllOrders;
283-
private:
284-
bool readWrite(const Ptr<FileNode>& readNode = nullptr, const Ptr<FileStorage>& writeStorage = nullptr);
285283
};
286284

287285
/**

modules/aruco/src/aruco_detector.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,27 +67,28 @@ bool DetectorParameters::writeDetectorParameters(const Ptr<FileStorage>& fs)
6767
return readWrite(nullptr, fs);
6868
}
6969

70-
bool RefineParameters::readWrite(const Ptr<FileNode>& readNode, const Ptr<FileStorage>& writeStorage) {
70+
static inline bool readWrite(RefineParameters& refineParameters, const Ptr<FileNode>& readNode,
71+
const Ptr<FileStorage>& writeStorage = nullptr) {
7172
CV_Assert(!readNode.empty() || !writeStorage.empty());
7273
bool check = false;
7374

74-
check |= readWriteParameter("minRepDistance", this->minRepDistance, readNode, writeStorage);
75-
check |= readWriteParameter("errorCorrectionRate", this->errorCorrectionRate, readNode, writeStorage);
76-
check |= readWriteParameter("checkAllOrders", this->checkAllOrders, readNode, writeStorage);
75+
check |= readWriteParameter("minRepDistance", refineParameters.minRepDistance, readNode, writeStorage);
76+
check |= readWriteParameter("errorCorrectionRate", refineParameters.errorCorrectionRate, readNode, writeStorage);
77+
check |= readWriteParameter("checkAllOrders", refineParameters.checkAllOrders, readNode, writeStorage);
7778
return check;
7879
}
7980

8081
bool RefineParameters::readRefineParameters(const FileNode &fn) {
8182
if(fn.empty())
8283
return false;
8384
Ptr<FileNode> pfn = makePtr<FileNode>(fn);
84-
return readWrite(pfn);
85+
return readWrite(*this, pfn);
8586
}
8687

8788
bool RefineParameters::writeRefineParameters(const Ptr<FileStorage> &fs) {
8889
if(fs.empty())
8990
return false;
90-
return readWrite(nullptr, fs);
91+
return readWrite(*this, nullptr, fs);
9192
}
9293

9394
/**

0 commit comments

Comments
 (0)