mirror of
https://github.com/opencv/opencv.git
synced 2026-07-26 05:43:05 +04:00
e19b0ebc5c
Migrated chessboard and circles grid detectors to objdetect #28804 OpenCV Contrib: https://github.com/opencv/opencv_contrib/pull/4125 OpenCV Extra: https://github.com/opencv/opencv_extra/pull/1375 ### 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 - [ ] The PR is proposed to the proper branch - [ ] There is a reference to the original bug report and related work - [ ] 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
43 lines
1.7 KiB
C++
43 lines
1.7 KiB
C++
#include "perf_precomp.hpp"
|
|
|
|
namespace opencv_test
|
|
{
|
|
using namespace perf;
|
|
|
|
typedef tuple<std::string, cv::Size> String_Size_t;
|
|
typedef perf::TestBaseWithParam<String_Size_t> String_Size;
|
|
|
|
PERF_TEST_P(String_Size, asymm_circles_grid, testing::Values(
|
|
String_Size_t("cv/cameracalibration/asymmetric_circles/acircles1.png", Size(7,13)),
|
|
String_Size_t("cv/cameracalibration/asymmetric_circles/acircles2.png", Size(7,13)),
|
|
String_Size_t("cv/cameracalibration/asymmetric_circles/acircles3.png", Size(7,13)),
|
|
String_Size_t("cv/cameracalibration/asymmetric_circles/acircles4.png", Size(5,5)),
|
|
String_Size_t("cv/cameracalibration/asymmetric_circles/acircles5.png", Size(5,5)),
|
|
String_Size_t("cv/cameracalibration/asymmetric_circles/acircles6.png", Size(5,5)),
|
|
String_Size_t("cv/cameracalibration/asymmetric_circles/acircles7.png", Size(3,9)),
|
|
String_Size_t("cv/cameracalibration/asymmetric_circles/acircles8.png", Size(3,9)),
|
|
String_Size_t("cv/cameracalibration/asymmetric_circles/acircles9.png", Size(3,9))
|
|
)
|
|
)
|
|
{
|
|
string filename = getDataPath(get<0>(GetParam()));
|
|
Size gridSize = get<1>(GetParam());
|
|
|
|
Mat frame = imread(filename);
|
|
if (frame.empty())
|
|
FAIL() << "Unable to load source image " << filename;
|
|
|
|
vector<Point2f> ptvec;
|
|
ptvec.resize(gridSize.area());
|
|
|
|
cvtColor(frame, frame, COLOR_BGR2GRAY);
|
|
|
|
declare.in(frame).out(ptvec);
|
|
|
|
TEST_CYCLE() ASSERT_TRUE(findCirclesGrid(frame, gridSize, ptvec, CALIB_CB_CLUSTERING | CALIB_CB_ASYMMETRIC_GRID));
|
|
|
|
SANITY_CHECK(ptvec, 2);
|
|
}
|
|
|
|
} // namespace
|