mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 03:33:28 +08:00

Megre together with https://github.com/opencv/opencv_contrib/pull/3325 1. Move aruco_detector, aruco_board, aruco_dictionary, aruco_utils to objdetect 1.1 add virtual Board::draw(), virtual ~Board() 1.2 move `testCharucoCornersCollinear` to Board classes (and rename to `checkCharucoCornersCollinear`) 1.3 add wrappers to keep the old api working 3. Reduce inludes 4. Fix java tests (add objdetect import) 5. Refactoring ### 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 another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the 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. - [x] The feature is well documented and sample code can be built with the project CMake ``` **WIP** force_builders=linux,win64,docs,Linux x64 Debug,Custom Xbuild_contrib:Docs=OFF build_image:Custom=ubuntu:22.04 build_worker:Custom=linux-1 ```
44 lines
1.2 KiB
C++
44 lines
1.2 KiB
C++
// This file is part of OpenCV project.
|
|
// It is subject to the license terms in the LICENSE file found in the top-level directory
|
|
// of this distribution and at http://opencv.org/license.html
|
|
#ifndef __OPENCV_OBJDETECT_ARUCO_UTILS_HPP__
|
|
#define __OPENCV_OBJDETECT_ARUCO_UTILS_HPP__
|
|
|
|
#include <opencv2/core.hpp>
|
|
#include <vector>
|
|
|
|
namespace cv {
|
|
namespace aruco {
|
|
|
|
/**
|
|
* @brief Copy the contents of a corners vector to an OutputArray, settings its size.
|
|
*/
|
|
void _copyVector2Output(std::vector<std::vector<Point2f> > &vec, OutputArrayOfArrays out, const float scale = 1.f);
|
|
|
|
/**
|
|
* @brief Convert input image to gray if it is a 3-channels image
|
|
*/
|
|
void _convertToGrey(InputArray _in, OutputArray _out);
|
|
|
|
template<typename T>
|
|
inline bool readParameter(const std::string& name, T& parameter, const FileNode& node)
|
|
{
|
|
if (!node.empty() && !node[name].empty()) {
|
|
node[name] >> parameter;
|
|
return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
template<typename T>
|
|
inline bool readWriteParameter(const std::string& name, T& parameter, const FileNode& readNode, FileStorage& writeStorage) {
|
|
if (!readNode.empty())
|
|
return readParameter(name, parameter, readNode);
|
|
writeStorage << name << parameter;
|
|
return true;
|
|
}
|
|
|
|
}
|
|
}
|
|
#endif
|