@@ -81,7 +81,7 @@ class MarkerPainter
8181}
8282
8383 std::pair<Mat, vector<Point2f> > getProjectMarker (int id, double yaw, double pitch,
84- const Ptr< aruco::DetectorParameters> & parameters,
84+ const aruco::DetectorParameters& parameters,
8585 const Ptr<aruco::Dictionary>& dictionary)
8686 {
8787 auto marker_corners = std::make_pair (Mat (imgMarkerSize, imgMarkerSize, CV_8UC1, Scalar::all (255 )), vector<Point2f>());
@@ -90,7 +90,7 @@ class MarkerPainter
9090
9191 // canonical image
9292 const int markerSizePixels = static_cast <int >(imgMarkerSize/sqrt (2 .f ));
93- aruco::drawMarker (dictionary, id, markerSizePixels, img, parameters-> markerBorderBits );
93+ aruco::drawMarker (dictionary, id, markerSizePixels, img, parameters. markerBorderBits );
9494
9595 // get rvec and tvec for the perspective
9696 const double distance = 0.1 ;
@@ -123,7 +123,7 @@ class MarkerPainter
123123 }
124124
125125 std::pair<Mat, map<int , vector<Point2f> > > getProjectMarkersTile (const int numMarkers,
126- const Ptr< aruco::DetectorParameters> & params,
126+ const aruco::DetectorParameters& params,
127127 const Ptr<aruco::Dictionary>& dictionary)
128128 {
129129 Mat tileImage (imgMarkerSize*numMarkers, imgMarkerSize*numMarkers, CV_8UC1, Scalar::all (255 ));
@@ -178,18 +178,18 @@ PERF_TEST_P(EstimateAruco, ArucoFirst, ESTIMATE_PARAMS)
178178{
179179 UseArucoParams testParams = GetParam ();
180180 Ptr<aruco::Dictionary> dictionary = aruco::getPredefinedDictionary (aruco::DICT_6X6_250);
181- Ptr< aruco::DetectorParameters> detectorParams = makePtr<aruco::DetectorParameters>() ;
182- detectorParams-> minDistanceToBorder = 1 ;
183- detectorParams-> markerBorderBits = 1 ;
184- detectorParams-> cornerRefinementMethod = cv::aruco::CORNER_REFINE_SUBPIX;
181+ aruco::DetectorParameters detectorParams;
182+ detectorParams. minDistanceToBorder = 1 ;
183+ detectorParams. markerBorderBits = 1 ;
184+ detectorParams. cornerRefinementMethod = cv::aruco::CORNER_REFINE_SUBPIX;
185185
186186 const int markerSize = 100 ;
187187 const int numMarkersInRow = 9 ;
188188 // USE_ARUCO3
189- detectorParams-> useAruco3Detection = get<0 >(testParams);
190- if (detectorParams-> useAruco3Detection ) {
191- detectorParams-> minSideLengthCanonicalImg = 32 ;
192- detectorParams-> minMarkerLengthRatioOriginalImg = 0 .04f / numMarkersInRow;
189+ detectorParams. useAruco3Detection = get<0 >(testParams);
190+ if (detectorParams. useAruco3Detection ) {
191+ detectorParams. minSideLengthCanonicalImg = 32 ;
192+ detectorParams. minMarkerLengthRatioOriginalImg = 0 .04f / numMarkersInRow;
193193 }
194194 aruco::ArucoDetector detector (dictionary, detectorParams);
195195 MarkerPainter painter (markerSize);
@@ -212,16 +212,16 @@ PERF_TEST_P(EstimateAruco, ArucoSecond, ESTIMATE_PARAMS)
212212{
213213 UseArucoParams testParams = GetParam ();
214214 Ptr<aruco::Dictionary> dictionary = aruco::getPredefinedDictionary (aruco::DICT_6X6_250);
215- Ptr< aruco::DetectorParameters> detectorParams = makePtr<aruco::DetectorParameters>() ;
216- detectorParams-> minDistanceToBorder = 1 ;
217- detectorParams-> markerBorderBits = 1 ;
218- detectorParams-> cornerRefinementMethod = cv::aruco::CORNER_REFINE_SUBPIX;
215+ aruco::DetectorParameters detectorParams;
216+ detectorParams. minDistanceToBorder = 1 ;
217+ detectorParams. markerBorderBits = 1 ;
218+ detectorParams. cornerRefinementMethod = cv::aruco::CORNER_REFINE_SUBPIX;
219219
220220 // USE_ARUCO3
221- detectorParams-> useAruco3Detection = get<0 >(testParams);
222- if (detectorParams-> useAruco3Detection ) {
223- detectorParams-> minSideLengthCanonicalImg = 64 ;
224- detectorParams-> minMarkerLengthRatioOriginalImg = 0 .f ;
221+ detectorParams. useAruco3Detection = get<0 >(testParams);
222+ if (detectorParams. useAruco3Detection ) {
223+ detectorParams. minSideLengthCanonicalImg = 64 ;
224+ detectorParams. minMarkerLengthRatioOriginalImg = 0 .f ;
225225 }
226226 aruco::ArucoDetector detector (dictionary, detectorParams);
227227 const int markerSize = 200 ;
@@ -268,16 +268,16 @@ PERF_TEST_P(EstimateLargeAruco, ArucoFHD, ESTIMATE_FHD_PARAMS)
268268{
269269 ArucoTestParams testParams = GetParam ();
270270 Ptr<aruco::Dictionary> dictionary = aruco::getPredefinedDictionary (aruco::DICT_6X6_250);
271- Ptr< aruco::DetectorParameters> detectorParams = makePtr<aruco::DetectorParameters>() ;
272- detectorParams-> minDistanceToBorder = 1 ;
273- detectorParams-> markerBorderBits = 1 ;
274- detectorParams-> cornerRefinementMethod = cv::aruco::CORNER_REFINE_SUBPIX;
271+ aruco::DetectorParameters detectorParams;
272+ detectorParams. minDistanceToBorder = 1 ;
273+ detectorParams. markerBorderBits = 1 ;
274+ detectorParams. cornerRefinementMethod = cv::aruco::CORNER_REFINE_SUBPIX;
275275
276276 // USE_ARUCO3
277- detectorParams-> useAruco3Detection = get<0 >(testParams).useAruco3Detection ;
278- if (detectorParams-> useAruco3Detection ) {
279- detectorParams-> minSideLengthCanonicalImg = get<0 >(testParams).minSideLengthCanonicalImg ;
280- detectorParams-> minMarkerLengthRatioOriginalImg = get<0 >(testParams).minMarkerLengthRatioOriginalImg ;
277+ detectorParams. useAruco3Detection = get<0 >(testParams).useAruco3Detection ;
278+ if (detectorParams. useAruco3Detection ) {
279+ detectorParams. minSideLengthCanonicalImg = get<0 >(testParams).minSideLengthCanonicalImg ;
280+ detectorParams. minMarkerLengthRatioOriginalImg = get<0 >(testParams).minMarkerLengthRatioOriginalImg ;
281281 }
282282 aruco::ArucoDetector detector (dictionary, detectorParams);
283283 const int markerSize = get<1 >(testParams).first ; // 1440 or 480 or 144
0 commit comments