@@ -10,7 +10,7 @@ namespace opencv_test { namespace {
10
10
11
11
TEST (CV_ArucoTutorial, can_find_singlemarkersoriginal)
12
12
{
13
- string img_path = cvtest::findDataFile (" singlemarkersoriginal.jpg" , false );
13
+ string img_path = cvtest::findDataFile (" aruco/ singlemarkersoriginal.jpg" , false );
14
14
Mat image = imread (img_path);
15
15
aruco::ArucoDetector detector (aruco::getPredefinedDictionary (aruco::DICT_6X6_250));
16
16
@@ -44,9 +44,9 @@ TEST(CV_ArucoTutorial, can_find_singlemarkersoriginal)
44
44
45
45
TEST (CV_ArucoTutorial, can_find_gboriginal)
46
46
{
47
- string imgPath = cvtest::findDataFile (" gboriginal.png " , false );
47
+ string imgPath = cvtest::findDataFile (" aruco/ gboriginal.jpg " , false );
48
48
Mat image = imread (imgPath);
49
- string dictPath = cvtest::findDataFile (" tutorial_dict.yml" , false );
49
+ string dictPath = cvtest::findDataFile (" aruco/ tutorial_dict.yml" , false );
50
50
aruco::Dictionary dictionary;
51
51
52
52
FileStorage fs (dictPath, FileStorage::READ);
@@ -99,7 +99,7 @@ TEST(CV_ArucoTutorial, can_find_gboriginal)
99
99
100
100
TEST (CV_ArucoTutorial, can_find_choriginal)
101
101
{
102
- string imgPath = cvtest::findDataFile (" choriginal.jpg" , false );
102
+ string imgPath = cvtest::findDataFile (" aruco/ choriginal.jpg" , false );
103
103
Mat image = imread (imgPath);
104
104
aruco::ArucoDetector detector (aruco::getPredefinedDictionary (aruco::DICT_6X6_250));
105
105
@@ -138,7 +138,7 @@ TEST(CV_ArucoTutorial, can_find_choriginal)
138
138
139
139
TEST (CV_ArucoTutorial, can_find_chocclusion)
140
140
{
141
- string imgPath = cvtest::findDataFile (" chocclusion_original.jpg" , false );
141
+ string imgPath = cvtest::findDataFile (" aruco/ chocclusion_original.jpg" , false );
142
142
Mat image = imread (imgPath);
143
143
aruco::ArucoDetector detector (aruco::getPredefinedDictionary (aruco::DICT_6X6_250));
144
144
@@ -176,15 +176,15 @@ TEST(CV_ArucoTutorial, can_find_chocclusion)
176
176
177
177
TEST (CV_ArucoTutorial, can_find_diamondmarkers)
178
178
{
179
- string imgPath = cvtest::findDataFile (" diamondmarkers.png " , false );
179
+ string imgPath = cvtest::findDataFile (" aruco/ diamondmarkers.jpg " , false );
180
180
Mat image = imread (imgPath);
181
181
182
- string dictPath = cvtest::findDataFile (" tutorial_dict.yml" , false );
182
+ string dictPath = cvtest::findDataFile (" aruco/ tutorial_dict.yml" , false );
183
183
aruco::Dictionary dictionary;
184
184
FileStorage fs (dictPath, FileStorage::READ);
185
185
dictionary.aruco ::Dictionary::readDictionary (fs.root ()); // set marker from tutorial_dict.yml
186
186
187
- string detectorPath = cvtest::findDataFile (" detector_params.yml" , false );
187
+ string detectorPath = cvtest::findDataFile (" aruco/ detector_params.yml" , false );
188
188
fs = FileStorage (detectorPath, FileStorage::READ);
189
189
aruco::DetectorParameters detectorParams;
190
190
detectorParams.readDetectorParameters (fs.root ());
@@ -203,13 +203,14 @@ TEST(CV_ArucoTutorial, can_find_diamondmarkers)
203
203
204
204
detector.detectMarkers (image, corners, ids, rejected);
205
205
map<int , int > counterRes;
206
+
207
+ ASSERT_EQ (N, ids.size ());
206
208
for (size_t i = 0 ; i < N; i++)
207
209
{
208
210
int arucoId = ids[i];
209
211
counterRes[arucoId]++;
210
212
}
211
213
212
- ASSERT_EQ (N, ids.size ());
213
214
EXPECT_EQ (counterGoldCornersIds, counterRes); // check the number of ArUco markers
214
215
}
215
216
0 commit comments