@@ -310,11 +310,11 @@ float EllipseDetectorImpl::getMedianSlope(std::vector<Point2f> &med, Point2f &ce
310310 // centers : centroid of the points in med
311311 // slopes : vector of the slopes
312312
313- unsigned pointCount = med.size ();
313+ size_t pointCount = med.size ();
314314 // CV_Assert(pointCount >= 2);
315315
316- unsigned halfSize = pointCount >> 1 ;
317- unsigned quarterSize = halfSize >> 1 ;
316+ size_t halfSize = pointCount >> 1 ;
317+ size_t quarterSize = halfSize >> 1 ;
318318
319319 std::vector<float > xx, yy;
320320 slopes.reserve (halfSize);
@@ -1341,7 +1341,7 @@ void EllipseDetectorImpl::preProcessing(Mat1b &image, Mat1b &dp, Mat1b &dn) {
13411341 }
13421342
13431343 const int CANNY_SHIFT = 15 ;
1344- const float TAN22_5 = 0.4142135623730950488016887242097 ; // tan(22.5) = sqrt(2) - 1
1344+ const float TAN22_5 = 0 .4142135623730950488016887242097f ; // tan(22.5) = sqrt(2) - 1
13451345 const int TG22 = (int ) (TAN22_5 * (1 << CANNY_SHIFT) + 0.5 );
13461346
13471347 // #define CANNY_PUSH(d) *(d) = (uchar)2, *stack_top++ = (d)
@@ -1723,8 +1723,8 @@ void EllipseDetectorImpl::findEllipses(Point2f ¢er, VP &edge_i, VP &edge_j,
17231723 }
17241724
17251725 // find peak in N and K accumulator
1726- int iN = std::distance (accN, std::max_element (accN, accN + ACC_N_SIZE));
1727- int iK = std::distance (accR, std::max_element (accR, accR + ACC_R_SIZE)) + 90 ;
1726+ int iN = ( int ) std::distance (accN, std::max_element (accN, accN + ACC_N_SIZE));
1727+ int iK = ( int ) std::distance (accR, std::max_element (accR, accR + ACC_R_SIZE)) + 90 ;
17281728
17291729 // recover real values
17301730 auto fK = float (iK);
@@ -1767,7 +1767,7 @@ void EllipseDetectorImpl::findEllipses(Point2f ¢er, VP &edge_i, VP &edge_j,
17671767 }
17681768
17691769 // find peak in A accumulator
1770- int A = std::distance (accA, std::max_element (accA, accA + ACC_A_SIZE));
1770+ int A = ( int ) std::distance (accA, std::max_element (accA, accA + ACC_A_SIZE));
17711771 auto fA = float (A);
17721772
17731773 // find B value. See Eq [23] in the paper
@@ -1974,15 +1974,14 @@ void findEllipses(
19741974 edi.detect (grayImage, ellipseResults);
19751975
19761976 // convert - ellipse format to std::vector<Vec6f>
1977- auto ellipseSize = unsigned (ellipseResults.size ());
1978- Mat _ellipses (1 , ellipseSize, CV_32FC (6 ));
1979- for (unsigned i = 0 ; i < ellipseSize; i++) {
1977+ std::vector<Vec6f> _ellipses;
1978+ for (size_t i = 0 ; i < ellipseResults.size (); i++) {
19801979 Ellipse tmpEll = ellipseResults[i];
19811980 Vec6f tmpVec (tmpEll.center .x , tmpEll.center .y , tmpEll.a , tmpEll.b , tmpEll.score ,
19821981 tmpEll.radius );
1983- _ellipses.at <Vec6f>(i) = tmpVec;
1982+ _ellipses.push_back ( tmpVec) ;
19841983 }
1985- _ellipses.copyTo (ellipses);
1984+ Mat ( _ellipses) .copyTo (ellipses);
19861985}
19871986} // namespace ximgproc
19881987} // namespace cv
0 commit comments