@@ -310,11 +310,11 @@ float EllipseDetectorImpl::getMedianSlope(std::vector<Point2f> &med, Point2f &ce
310
310
// centers : centroid of the points in med
311
311
// slopes : vector of the slopes
312
312
313
- unsigned pointCount = med.size ();
313
+ size_t pointCount = med.size ();
314
314
// CV_Assert(pointCount >= 2);
315
315
316
- unsigned halfSize = pointCount >> 1 ;
317
- unsigned quarterSize = halfSize >> 1 ;
316
+ size_t halfSize = pointCount >> 1 ;
317
+ size_t quarterSize = halfSize >> 1 ;
318
318
319
319
std::vector<float > xx, yy;
320
320
slopes.reserve (halfSize);
@@ -1341,7 +1341,7 @@ void EllipseDetectorImpl::preProcessing(Mat1b &image, Mat1b &dp, Mat1b &dn) {
1341
1341
}
1342
1342
1343
1343
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
1345
1345
const int TG22 = (int ) (TAN22_5 * (1 << CANNY_SHIFT) + 0.5 );
1346
1346
1347
1347
// #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,
1723
1723
}
1724
1724
1725
1725
// 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 ;
1728
1728
1729
1729
// recover real values
1730
1730
auto fK = float (iK);
@@ -1767,7 +1767,7 @@ void EllipseDetectorImpl::findEllipses(Point2f ¢er, VP &edge_i, VP &edge_j,
1767
1767
}
1768
1768
1769
1769
// 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));
1771
1771
auto fA = float (A);
1772
1772
1773
1773
// find B value. See Eq [23] in the paper
@@ -1974,15 +1974,14 @@ void findEllipses(
1974
1974
edi.detect (grayImage, ellipseResults);
1975
1975
1976
1976
// 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++) {
1980
1979
Ellipse tmpEll = ellipseResults[i];
1981
1980
Vec6f tmpVec (tmpEll.center .x , tmpEll.center .y , tmpEll.a , tmpEll.b , tmpEll.score ,
1982
1981
tmpEll.radius );
1983
- _ellipses.at <Vec6f>(i) = tmpVec;
1982
+ _ellipses.push_back ( tmpVec) ;
1984
1983
}
1985
- _ellipses.copyTo (ellipses);
1984
+ Mat ( _ellipses) .copyTo (ellipses);
1986
1985
}
1987
1986
} // namespace ximgproc
1988
1987
} // namespace cv
0 commit comments