@@ -128,7 +128,7 @@ static void _getMaximumSubPixWindowSizes(InputArrayOfArrays markerCorners, Input
128128
129129 for (unsigned int i = 0 ; i < nCharucoCorners; i++) {
130130 if (charucoCorners.getMat ().at < Point2f >(i) == Point2f (-1 , -1 )) continue ;
131- if (board->getNearestMarkerIdx ()[i].size () == 0 ) continue ;
131+ if (board->getNearestMarkerIdx ()[i].empty () ) continue ;
132132
133133 double minDist = -1 ;
134134 int counter = 0 ;
@@ -461,47 +461,5 @@ void drawCharucoDiamond(const Ptr<Dictionary> &dictionary, Vec4i ids, int square
461461 board->generateImage (outSize, _img, marginSize, borderBits);
462462}
463463
464-
465- void drawDetectedDiamonds (InputOutputArray _image, InputArrayOfArrays _corners, InputArray _ids, Scalar borderColor) {
466- CV_Assert (_image.getMat ().total () != 0 &&
467- (_image.getMat ().channels () == 1 || _image.getMat ().channels () == 3 ));
468- CV_Assert ((_corners.total () == _ids.total ()) || _ids.total () == 0 );
469-
470- // calculate colors
471- Scalar textColor, cornerColor;
472- textColor = cornerColor = borderColor;
473- swap (textColor.val [0 ], textColor.val [1 ]); // text color just sawp G and R
474- swap (cornerColor.val [1 ], cornerColor.val [2 ]); // corner color just sawp G and B
475-
476- int nMarkers = (int )_corners.total ();
477- for (int i = 0 ; i < nMarkers; i++) {
478- Mat currentMarker = _corners.getMat (i);
479- CV_Assert (currentMarker.total () == 4 && currentMarker.type () == CV_32FC2);
480-
481- // draw marker sides
482- for (int j = 0 ; j < 4 ; j++) {
483- Point2f p0, p1;
484- p0 = currentMarker.at < Point2f >(j);
485- p1 = currentMarker.at < Point2f >((j + 1 ) % 4 );
486- line (_image, p0, p1, borderColor, 1 );
487- }
488-
489- // draw first corner mark
490- rectangle (_image, currentMarker.at < Point2f >(0 ) - Point2f (3 , 3 ),
491- currentMarker.at < Point2f >(0 ) + Point2f (3 , 3 ), cornerColor, 1 , LINE_AA);
492-
493- // draw id composed by four numbers
494- if (_ids.total () != 0 ) {
495- Point2f cent (0 , 0 );
496- for (int p = 0 ; p < 4 ; p++)
497- cent += currentMarker.at < Point2f >(p);
498- cent = cent / 4 .;
499- stringstream s;
500- s << " id=" << _ids.getMat ().at < Vec4i >(i);
501- putText (_image, s.str (), cent, FONT_HERSHEY_SIMPLEX, 0.5 , textColor, 2 );
502- }
503- }
504- }
505-
506464}
507465}
0 commit comments