Skip to content

Commit 4326ae5

Browse files
author
AleksandrPanov
committed
remove readWrite() from API
1 parent db55474 commit 4326ae5

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

modules/aruco/include/opencv2/aruco/board.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,10 @@ class CV_EXPORTS_W CharucoBoard : public Board {
211211
* @return bool value, 1 (true) if detected corners form a line, 0 (false) if they do not.
212212
solvePnP, calibration functions will fail if the corners are collinear (true).
213213
*
214-
* The number of ids in charucoIDs should be <= the number of chessboard corners in the board. This functions checks whether the charuco corners are on a straight line (returns true, if so), or not (false). Axis parallel, as well as diagonal and other straight lines detected. Degenerate cases: for number of charucoIDs <= 2, the function returns true.
214+
* The number of ids in charucoIDs should be <= the number of chessboard corners in the board.
215+
* This functions checks whether the charuco corners are on a straight line (returns true, if so), or not (false).
216+
* Axis parallel, as well as diagonal and other straight lines detected. Degenerate cases:
217+
* for number of charucoIDs <= 2,the function returns true.
215218
*/
216219
CV_EXPORTS_W bool testCharucoCornersCollinear(const Ptr<CharucoBoard> &board, InputArray charucoIds);
217220

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)