Remove all using directives for STL namespace and members
Made all STL usages explicit to be able automatically find all usages of particular class or function.
This commit is contained in:
@@ -1256,8 +1256,8 @@ static void initLabTabs()
|
||||
for(i = 0; i <= GAMMA_TAB_SIZE; i++)
|
||||
{
|
||||
float x = i*scale;
|
||||
g[i] = x <= 0.04045f ? x*(1.f/12.92f) : (float)pow((double)(x + 0.055)*(1./1.055), 2.4);
|
||||
ig[i] = x <= 0.0031308 ? x*12.92f : (float)(1.055*pow((double)x, 1./2.4) - 0.055);
|
||||
g[i] = x <= 0.04045f ? x*(1.f/12.92f) : (float)std::pow((double)(x + 0.055)*(1./1.055), 2.4);
|
||||
ig[i] = x <= 0.0031308 ? x*12.92f : (float)(1.055*std::pow((double)x, 1./2.4) - 0.055);
|
||||
}
|
||||
splineBuild(g, GAMMA_TAB_SIZE, sRGBGammaTab);
|
||||
splineBuild(ig, GAMMA_TAB_SIZE, sRGBInvGammaTab);
|
||||
@@ -1265,7 +1265,7 @@ static void initLabTabs()
|
||||
for(i = 0; i < 256; i++)
|
||||
{
|
||||
float x = i*(1.f/255.f);
|
||||
sRGBGammaTab_b[i] = saturate_cast<ushort>(255.f*(1 << gamma_shift)*(x <= 0.04045f ? x*(1.f/12.92f) : (float)pow((double)(x + 0.055)*(1./1.055), 2.4)));
|
||||
sRGBGammaTab_b[i] = saturate_cast<ushort>(255.f*(1 << gamma_shift)*(x <= 0.04045f ? x*(1.f/12.92f) : (float)std::pow((double)(x + 0.055)*(1./1.055), 2.4)));
|
||||
linearGammaTab_b[i] = (ushort)(i*(1 << gamma_shift));
|
||||
}
|
||||
|
||||
@@ -1408,9 +1408,9 @@ struct RGB2Lab_f
|
||||
float Y = R*C3 + G*C4 + B*C5;
|
||||
float Z = R*C6 + G*C7 + B*C8;
|
||||
|
||||
float FX = X > 0.008856f ? pow(X, _1_3) : (7.787f * X + _a);
|
||||
float FY = Y > 0.008856f ? pow(Y, _1_3) : (7.787f * Y + _a);
|
||||
float FZ = Z > 0.008856f ? pow(Z, _1_3) : (7.787f * Z + _a);
|
||||
float FX = X > 0.008856f ? std::pow(X, _1_3) : (7.787f * X + _a);
|
||||
float FY = Y > 0.008856f ? std::pow(Y, _1_3) : (7.787f * Y + _a);
|
||||
float FZ = Z > 0.008856f ? std::pow(Z, _1_3) : (7.787f * Z + _a);
|
||||
|
||||
float L = Y > 0.008856f ? (116.f * FY - 16.f) : (903.3f * Y);
|
||||
float a = 500.f * (FX - FY);
|
||||
|
@@ -113,7 +113,7 @@ static int Sklansky_( Point_<_Tp>** array, int start, int end, int* stack, int n
|
||||
stack[stacksize-1] = pnext;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return --stacksize;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ void convexHull( InputArray _points, OutputArray _hull, bool clockwise, bool ret
|
||||
for( i = tr_count - 1; i > 0; i-- )
|
||||
hullbuf[nout++] = pointer[tr_stack[i]] - data0;
|
||||
int stop_idx = tr_count > 2 ? tr_stack[1] : tl_count > 2 ? tl_stack[tl_count - 2] : -1;
|
||||
|
||||
|
||||
// lower half
|
||||
int *bl_stack = stack;
|
||||
int bl_count = !is_float ?
|
||||
@@ -280,7 +280,7 @@ void convexityDefects( InputArray _points, InputArray _hull, OutputArray _defect
|
||||
|
||||
const Point* ptr = (const Point*)points.data;
|
||||
const int* hptr = hull.ptr<int>();
|
||||
vector<Vec4i> defects;
|
||||
std::vector<Vec4i> defects;
|
||||
|
||||
// 1. recognize co-orientation of the contour and its hull
|
||||
bool rev_orientation = ((hptr[1] > hptr[0]) + (hptr[2] > hptr[1]) + (hptr[0] > hptr[2])) != 2;
|
||||
@@ -297,7 +297,7 @@ void convexityDefects( InputArray _points, InputArray _hull, OutputArray _defect
|
||||
Point pt0 = ptr[hcurr], pt1 = ptr[hnext];
|
||||
double dx0 = pt1.x - pt0.x;
|
||||
double dy0 = pt1.y - pt0.y;
|
||||
double scale = dx0 == 0 && dy0 == 0 ? 0. : 1./sqrt(dx0*dx0 + dy0*dy0);
|
||||
double scale = dx0 == 0 && dy0 == 0 ? 0. : 1./std::sqrt(dx0*dx0 + dy0*dy0);
|
||||
|
||||
int defect_deepest_point = -1;
|
||||
double defect_depth = 0;
|
||||
@@ -380,10 +380,10 @@ bool isContourConvex( InputArray _contour )
|
||||
Mat contour = _contour.getMat();
|
||||
int total = contour.checkVector(2), depth = contour.depth();
|
||||
CV_Assert(total >= 0 && (depth == CV_32F || depth == CV_32S));
|
||||
|
||||
|
||||
if( total == 0 )
|
||||
return false;
|
||||
|
||||
|
||||
return depth == CV_32S ?
|
||||
isContourConvex_((const Point*)contour.data, total ) :
|
||||
isContourConvex_((const Point2f*)contour.data, total );
|
||||
@@ -502,7 +502,7 @@ cvConvexHull2( const CvArr* array, void* hull_storage,
|
||||
ptseq->header_size < (int)sizeof(CvContour) ||
|
||||
&ptseq->flags == &contour_header.flags );
|
||||
}
|
||||
|
||||
|
||||
return hull.s;
|
||||
}
|
||||
|
||||
@@ -658,7 +658,7 @@ CV_IMPL CvSeq* cvConvexityDefects( const CvArr* array,
|
||||
dx0 = (double)hull_next->x - (double)hull_cur->x;
|
||||
dy0 = (double)hull_next->y - (double)hull_cur->y;
|
||||
assert( dx0 != 0 || dy0 != 0 );
|
||||
scale = 1./sqrt(dx0*dx0 + dy0*dy0);
|
||||
scale = 1./std::sqrt(dx0*dx0 + dy0*dy0);
|
||||
|
||||
defect.start = hull_cur;
|
||||
defect.end = hull_next;
|
||||
|
@@ -100,7 +100,7 @@ static void getSobelKernels( OutputArray _kx, OutputArray _ky,
|
||||
|
||||
if( _ksize % 2 == 0 || _ksize > 31 )
|
||||
CV_Error( CV_StsOutOfRange, "The kernel size must be odd and not larger than 31" );
|
||||
vector<int> kerI(std::max(ksizeX, ksizeY) + 1);
|
||||
std::vector<int> kerI(std::max(ksizeX, ksizeY) + 1);
|
||||
|
||||
CV_Assert( dx >= 0 && dy >= 0 && dx+dy > 0 );
|
||||
|
||||
|
@@ -75,7 +75,7 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
|
||||
|
||||
Size imgsize = image.size();
|
||||
|
||||
vector<const float*> tmpCorners;
|
||||
std::vector<const float*> tmpCorners;
|
||||
|
||||
// collect list of pointers to features - put them into temporary image
|
||||
for( int y = 1; y < imgsize.height - 1; y++ )
|
||||
@@ -93,7 +93,7 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
|
||||
}
|
||||
|
||||
sort( tmpCorners, greaterThanPtr<float>() );
|
||||
vector<Point2f> corners;
|
||||
std::vector<Point2f> corners;
|
||||
size_t i, j, total = tmpCorners.size(), ncorners = 0;
|
||||
|
||||
if(minDistance >= 1)
|
||||
@@ -136,7 +136,7 @@ void cv::goodFeaturesToTrack( InputArray _image, OutputArray _corners,
|
||||
{
|
||||
for( int xx = x1; xx <= x2; xx++ )
|
||||
{
|
||||
vector <Point2f> &m = grid[yy*grid_width + xx];
|
||||
std::vector <Point2f> &m = grid[yy*grid_width + xx];
|
||||
|
||||
if( m.size() )
|
||||
{
|
||||
@@ -224,7 +224,7 @@ cvGoodFeaturesToTrack( const void* _image, void*, void*,
|
||||
int use_harris, double harris_k )
|
||||
{
|
||||
cv::Mat image = cv::cvarrToMat(_image), mask;
|
||||
cv::vector<cv::Point2f> corners;
|
||||
std::vector<cv::Point2f> corners;
|
||||
|
||||
if( _maskImage )
|
||||
mask = cv::cvarrToMat(_maskImage);
|
||||
|
@@ -1954,7 +1954,7 @@ struct FilterVec_8u
|
||||
Mat kernel;
|
||||
_kernel.convertTo(kernel, CV_32F, 1./(1 << _bits), 0);
|
||||
delta = (float)(_delta/(1 << _bits));
|
||||
vector<Point> coords;
|
||||
std::vector<Point> coords;
|
||||
preprocess2DKernel(kernel, coords, coeffs);
|
||||
_nz = (int)coords.size();
|
||||
}
|
||||
@@ -2024,7 +2024,7 @@ struct FilterVec_8u
|
||||
}
|
||||
|
||||
int _nz;
|
||||
vector<uchar> coeffs;
|
||||
std::vector<uchar> coeffs;
|
||||
float delta;
|
||||
};
|
||||
|
||||
@@ -2037,7 +2037,7 @@ struct FilterVec_8u16s
|
||||
Mat kernel;
|
||||
_kernel.convertTo(kernel, CV_32F, 1./(1 << _bits), 0);
|
||||
delta = (float)(_delta/(1 << _bits));
|
||||
vector<Point> coords;
|
||||
std::vector<Point> coords;
|
||||
preprocess2DKernel(kernel, coords, coeffs);
|
||||
_nz = (int)coords.size();
|
||||
}
|
||||
@@ -2107,7 +2107,7 @@ struct FilterVec_8u16s
|
||||
}
|
||||
|
||||
int _nz;
|
||||
vector<uchar> coeffs;
|
||||
std::vector<uchar> coeffs;
|
||||
float delta;
|
||||
};
|
||||
|
||||
@@ -2118,7 +2118,7 @@ struct FilterVec_32f
|
||||
FilterVec_32f(const Mat& _kernel, int, double _delta)
|
||||
{
|
||||
delta = (float)_delta;
|
||||
vector<Point> coords;
|
||||
std::vector<Point> coords;
|
||||
preprocess2DKernel(_kernel, coords, coeffs);
|
||||
_nz = (int)coords.size();
|
||||
}
|
||||
@@ -2179,7 +2179,7 @@ struct FilterVec_32f
|
||||
}
|
||||
|
||||
int _nz;
|
||||
vector<uchar> coeffs;
|
||||
std::vector<uchar> coeffs;
|
||||
float delta;
|
||||
};
|
||||
|
||||
@@ -2989,7 +2989,7 @@ cv::Ptr<cv::FilterEngine> cv::createSeparableLinearFilter(
|
||||
namespace cv
|
||||
{
|
||||
|
||||
void preprocess2DKernel( const Mat& kernel, vector<Point>& coords, vector<uchar>& coeffs )
|
||||
void preprocess2DKernel( const Mat& kernel, std::vector<Point>& coords, std::vector<uchar>& coeffs )
|
||||
{
|
||||
int i, j, k, nz = countNonZero(kernel), ktype = kernel.type();
|
||||
if(nz == 0)
|
||||
@@ -3107,9 +3107,9 @@ template<typename ST, class CastOp, class VecOp> struct Filter2D : public BaseFi
|
||||
}
|
||||
}
|
||||
|
||||
vector<Point> coords;
|
||||
vector<uchar> coeffs;
|
||||
vector<uchar*> ptrs;
|
||||
std::vector<Point> coords;
|
||||
std::vector<uchar> coeffs;
|
||||
std::vector<uchar*> ptrs;
|
||||
KT delta;
|
||||
CastOp castOp0;
|
||||
VecOp vecOp;
|
||||
|
@@ -457,7 +457,7 @@ int cv::floodFill( InputOutputArray _image, InputOutputArray _mask,
|
||||
Scalar loDiff, Scalar upDiff, int flags )
|
||||
{
|
||||
ConnectedComp comp;
|
||||
vector<FFillSegment> buffer;
|
||||
std::vector<FFillSegment> buffer;
|
||||
|
||||
if( rect )
|
||||
*rect = Rect();
|
||||
|
@@ -84,7 +84,7 @@ cv::Mat cv::getGaborKernel( Size ksize, double sigma, double theta,
|
||||
double xr = x*c + y*s;
|
||||
double yr = -x*s + y*c;
|
||||
|
||||
double v = scale*exp(ex*xr*xr + ey*yr*yr)*cos(cscale*xr + psi);
|
||||
double v = scale*std::exp(ex*xr*xr + ey*yr*yr)*cos(cscale*xr + psi);
|
||||
if( ktype == CV_32F )
|
||||
kernel.at<float>(ymax - y, xmax - x) = (float)v;
|
||||
else
|
||||
|
@@ -42,7 +42,6 @@
|
||||
#include "precomp.hpp"
|
||||
#include <functional>
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
|
||||
namespace
|
||||
@@ -50,9 +49,9 @@ namespace
|
||||
/////////////////////////////////////
|
||||
// Common
|
||||
|
||||
template <typename T, class A> void releaseVector(vector<T, A>& v)
|
||||
template <typename T, class A> void releaseVector(std::vector<T, A>& v)
|
||||
{
|
||||
vector<T, A> empty;
|
||||
std::vector<T, A> empty;
|
||||
empty.swap(v);
|
||||
}
|
||||
|
||||
@@ -63,7 +62,7 @@ namespace
|
||||
|
||||
bool notNull(float v)
|
||||
{
|
||||
return fabs(v) > numeric_limits<float>::epsilon();
|
||||
return fabs(v) > std::numeric_limits<float>::epsilon();
|
||||
}
|
||||
|
||||
class GHT_Pos : public GeneralizedHough
|
||||
@@ -95,8 +94,8 @@ namespace
|
||||
Mat imageDx;
|
||||
Mat imageDy;
|
||||
|
||||
vector<Vec4f> posOutBuf;
|
||||
vector<Vec3i> voteOutBuf;
|
||||
std::vector<Vec4f> posOutBuf;
|
||||
std::vector<Vec3i> voteOutBuf;
|
||||
};
|
||||
|
||||
GHT_Pos::GHT_Pos()
|
||||
@@ -168,10 +167,10 @@ namespace
|
||||
|
||||
CV_Assert(!hasVotes || voteOutBuf.size() == oldSize);
|
||||
|
||||
vector<Vec4f> oldPosBuf(posOutBuf);
|
||||
vector<Vec3i> oldVoteBuf(voteOutBuf);
|
||||
std::vector<Vec4f> oldPosBuf(posOutBuf);
|
||||
std::vector<Vec3i> oldVoteBuf(voteOutBuf);
|
||||
|
||||
vector<size_t> indexies(oldSize);
|
||||
std::vector<size_t> indexies(oldSize);
|
||||
for (size_t i = 0; i < oldSize; ++i)
|
||||
indexies[i] = i;
|
||||
sortIndexies(&indexies[0], oldSize, &oldVoteBuf[0]);
|
||||
@@ -183,7 +182,7 @@ namespace
|
||||
const int gridWidth = (imageSize.width + cellSize - 1) / cellSize;
|
||||
const int gridHeight = (imageSize.height + cellSize - 1) / cellSize;
|
||||
|
||||
vector< vector<Point2f> > grid(gridWidth * gridHeight);
|
||||
std::vector< std::vector<Point2f> > grid(gridWidth * gridHeight);
|
||||
|
||||
const double minDist2 = minDist * minDist;
|
||||
|
||||
@@ -213,7 +212,7 @@ namespace
|
||||
{
|
||||
for (int xx = x1; xx <= x2; ++xx)
|
||||
{
|
||||
const vector<Point2f>& m = grid[yy * gridWidth + xx];
|
||||
const std::vector<Point2f>& m = grid[yy * gridWidth + xx];
|
||||
|
||||
for(size_t j = 0; j < m.size(); ++j)
|
||||
{
|
||||
@@ -288,7 +287,7 @@ namespace
|
||||
int votesThreshold;
|
||||
double dp;
|
||||
|
||||
vector< vector<Point> > r_table;
|
||||
std::vector< std::vector<Point> > r_table;
|
||||
Mat hist;
|
||||
};
|
||||
|
||||
@@ -327,7 +326,7 @@ namespace
|
||||
const double thetaScale = levels / 360.0;
|
||||
|
||||
r_table.resize(levels + 1);
|
||||
for_each(r_table.begin(), r_table.end(), mem_fun_ref(&vector<Point>::clear));
|
||||
for_each(r_table.begin(), r_table.end(), mem_fun_ref(&std::vector<Point>::clear));
|
||||
|
||||
for (int y = 0; y < templSize.height; ++y)
|
||||
{
|
||||
@@ -387,7 +386,7 @@ namespace
|
||||
const float theta = fastAtan2(dyRow[x], dxRow[x]);
|
||||
const int n = cvRound(theta * thetaScale);
|
||||
|
||||
const vector<Point>& r_row = r_table[n];
|
||||
const std::vector<Point>& r_row = r_table[n];
|
||||
|
||||
for (size_t j = 0; j < r_row.size(); ++j)
|
||||
{
|
||||
@@ -512,7 +511,7 @@ namespace
|
||||
const float theta = fastAtan2(dyRow[x], dxRow[x]);
|
||||
const int n = cvRound(theta * thetaScale);
|
||||
|
||||
const vector<Point>& r_row = base->r_table[n];
|
||||
const std::vector<Point>& r_row = base->r_table[n];
|
||||
|
||||
for (size_t j = 0; j < r_row.size(); ++j)
|
||||
{
|
||||
@@ -682,7 +681,7 @@ namespace
|
||||
theta += 360.0;
|
||||
const int n = cvRound(theta * thetaScale);
|
||||
|
||||
const vector<Point>& r_row = base->r_table[n];
|
||||
const std::vector<Point>& r_row = base->r_table[n];
|
||||
|
||||
for (size_t j = 0; j < r_row.size(); ++j)
|
||||
{
|
||||
@@ -816,8 +815,8 @@ namespace
|
||||
Point2d r2;
|
||||
};
|
||||
|
||||
void buildFeatureList(const Mat& edges, const Mat& dx, const Mat& dy, vector< vector<Feature> >& features, Point2d center = Point2d());
|
||||
void getContourPoints(const Mat& edges, const Mat& dx, const Mat& dy, vector<ContourPoint>& points);
|
||||
void buildFeatureList(const Mat& edges, const Mat& dx, const Mat& dy, std::vector< std::vector<Feature> >& features, Point2d center = Point2d());
|
||||
void getContourPoints(const Mat& edges, const Mat& dx, const Mat& dy, std::vector<ContourPoint>& points);
|
||||
|
||||
void calcOrientation();
|
||||
void calcScale(double angle);
|
||||
@@ -841,11 +840,11 @@ namespace
|
||||
double dp;
|
||||
int posThresh;
|
||||
|
||||
vector< vector<Feature> > templFeatures;
|
||||
vector< vector<Feature> > imageFeatures;
|
||||
std::vector< std::vector<Feature> > templFeatures;
|
||||
std::vector< std::vector<Feature> > imageFeatures;
|
||||
|
||||
vector< pair<double, int> > angles;
|
||||
vector< pair<double, int> > scales;
|
||||
std::vector< std::pair<double, int> > angles;
|
||||
std::vector< std::pair<double, int> > scales;
|
||||
};
|
||||
|
||||
CV_INIT_ALGORITHM(GHT_Guil_Full, "GeneralizedHough.POSITION_SCALE_ROTATION",
|
||||
@@ -940,7 +939,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void GHT_Guil_Full::buildFeatureList(const Mat& edges, const Mat& dx, const Mat& dy, vector< vector<Feature> >& features, Point2d center)
|
||||
void GHT_Guil_Full::buildFeatureList(const Mat& edges, const Mat& dx, const Mat& dy, std::vector< std::vector<Feature> >& features, Point2d center)
|
||||
{
|
||||
CV_Assert(levels > 0);
|
||||
|
||||
@@ -948,12 +947,12 @@ namespace
|
||||
|
||||
const double alphaScale = levels / 360.0;
|
||||
|
||||
vector<ContourPoint> points;
|
||||
std::vector<ContourPoint> points;
|
||||
getContourPoints(edges, dx, dy, points);
|
||||
|
||||
features.resize(levels + 1);
|
||||
for_each(features.begin(), features.end(), mem_fun_ref(&vector<Feature>::clear));
|
||||
for_each(features.begin(), features.end(), bind2nd(mem_fun_ref(&vector<Feature>::reserve), maxSize));
|
||||
for_each(features.begin(), features.end(), mem_fun_ref(&std::vector<Feature>::clear));
|
||||
for_each(features.begin(), features.end(), bind2nd(mem_fun_ref(&std::vector<Feature>::reserve), maxSize));
|
||||
|
||||
for (size_t i = 0; i < points.size(); ++i)
|
||||
{
|
||||
@@ -990,7 +989,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
void GHT_Guil_Full::getContourPoints(const Mat& edges, const Mat& dx, const Mat& dy, vector<ContourPoint>& points)
|
||||
void GHT_Guil_Full::getContourPoints(const Mat& edges, const Mat& dx, const Mat& dy, std::vector<ContourPoint>& points)
|
||||
{
|
||||
CV_Assert(edges.type() == CV_8UC1);
|
||||
CV_Assert(dx.type() == CV_32FC1 && dx.size == edges.size);
|
||||
@@ -1032,11 +1031,11 @@ namespace
|
||||
const double iAngleStep = 1.0 / angleStep;
|
||||
const int angleRange = cvCeil((maxAngle - minAngle) * iAngleStep);
|
||||
|
||||
vector<int> OHist(angleRange + 1, 0);
|
||||
std::vector<int> OHist(angleRange + 1, 0);
|
||||
for (int i = 0; i <= levels; ++i)
|
||||
{
|
||||
const vector<Feature>& templRow = templFeatures[i];
|
||||
const vector<Feature>& imageRow = imageFeatures[i];
|
||||
const std::vector<Feature>& templRow = templFeatures[i];
|
||||
const std::vector<Feature>& imageRow = imageFeatures[i];
|
||||
|
||||
for (size_t j = 0; j < templRow.size(); ++j)
|
||||
{
|
||||
@@ -1063,7 +1062,7 @@ namespace
|
||||
if (OHist[n] >= angleThresh)
|
||||
{
|
||||
const double angle = minAngle + n * angleStep;
|
||||
angles.push_back(make_pair(angle, OHist[n]));
|
||||
angles.push_back(std::make_pair(angle, OHist[n]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1080,12 +1079,12 @@ namespace
|
||||
const double iScaleStep = 1.0 / scaleStep;
|
||||
const int scaleRange = cvCeil((maxScale - minScale) * iScaleStep);
|
||||
|
||||
vector<int> SHist(scaleRange + 1, 0);
|
||||
std::vector<int> SHist(scaleRange + 1, 0);
|
||||
|
||||
for (int i = 0; i <= levels; ++i)
|
||||
{
|
||||
const vector<Feature>& templRow = templFeatures[i];
|
||||
const vector<Feature>& imageRow = imageFeatures[i];
|
||||
const std::vector<Feature>& templRow = templFeatures[i];
|
||||
const std::vector<Feature>& imageRow = imageFeatures[i];
|
||||
|
||||
for (size_t j = 0; j < templRow.size(); ++j)
|
||||
{
|
||||
@@ -1117,7 +1116,7 @@ namespace
|
||||
if (SHist[s] >= scaleThresh)
|
||||
{
|
||||
const double scale = minScale + s * scaleStep;
|
||||
scales.push_back(make_pair(scale, SHist[s]));
|
||||
scales.push_back(std::make_pair(scale, SHist[s]));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1141,8 +1140,8 @@ namespace
|
||||
|
||||
for (int i = 0; i <= levels; ++i)
|
||||
{
|
||||
const vector<Feature>& templRow = templFeatures[i];
|
||||
const vector<Feature>& imageRow = imageFeatures[i];
|
||||
const std::vector<Feature>& templRow = templFeatures[i];
|
||||
const std::vector<Feature>& imageRow = imageFeatures[i];
|
||||
|
||||
for (size_t j = 0; j < templRow.size(); ++j)
|
||||
{
|
||||
|
@@ -231,13 +231,13 @@ double cv::pointPolygonTest( InputArray _contour, Point2f pt, bool measureDist )
|
||||
dist_num = -dist_num;
|
||||
counter += dist_num > 0;
|
||||
}
|
||||
|
||||
result = sqrt(min_dist_num/min_dist_denom);
|
||||
|
||||
result = std::sqrt(min_dist_num/min_dist_denom);
|
||||
if( counter % 2 == 0 )
|
||||
result = -result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -347,10 +347,10 @@ static void initMaskWithRect( Mat& mask, Size imgSize, Rect rect )
|
||||
mask.create( imgSize, CV_8UC1 );
|
||||
mask.setTo( GC_BGD );
|
||||
|
||||
rect.x = max(0, rect.x);
|
||||
rect.y = max(0, rect.y);
|
||||
rect.width = min(rect.width, imgSize.width-rect.x);
|
||||
rect.height = min(rect.height, imgSize.height-rect.y);
|
||||
rect.x = std::max(0, rect.x);
|
||||
rect.y = std::max(0, rect.y);
|
||||
rect.width = std::min(rect.width, imgSize.width-rect.x);
|
||||
rect.height = std::min(rect.height, imgSize.height-rect.y);
|
||||
|
||||
(mask(rect)).setTo( Scalar(GC_PR_FGD) );
|
||||
}
|
||||
@@ -364,7 +364,7 @@ static void initGMMs( const Mat& img, const Mat& mask, GMM& bgdGMM, GMM& fgdGMM
|
||||
const int kMeansType = KMEANS_PP_CENTERS;
|
||||
|
||||
Mat bgdLabels, fgdLabels;
|
||||
vector<Vec3f> bgdSamples, fgdSamples;
|
||||
std::vector<Vec3f> bgdSamples, fgdSamples;
|
||||
Point p;
|
||||
for( p.y = 0; p.y < img.rows; p.y++ )
|
||||
{
|
||||
|
@@ -54,7 +54,7 @@ static const size_t OUT_OF_RANGE = (size_t)1 << (sizeof(size_t)*8 - 2);
|
||||
static void
|
||||
calcHistLookupTables_8u( const Mat& hist, const SparseMat& shist,
|
||||
int dims, const float** ranges, const double* uniranges,
|
||||
bool uniform, bool issparse, vector<size_t>& _tab )
|
||||
bool uniform, bool issparse, std::vector<size_t>& _tab )
|
||||
{
|
||||
const int low = 0, high = 256;
|
||||
int i, j;
|
||||
@@ -117,8 +117,8 @@ calcHistLookupTables_8u( const Mat& hist, const SparseMat& shist,
|
||||
static void histPrepareImages( const Mat* images, int nimages, const int* channels,
|
||||
const Mat& mask, int dims, const int* histSize,
|
||||
const float** ranges, bool uniform,
|
||||
vector<uchar*>& ptrs, vector<int>& deltas,
|
||||
Size& imsize, vector<double>& uniranges )
|
||||
std::vector<uchar*>& ptrs, std::vector<int>& deltas,
|
||||
Size& imsize, std::vector<double>& uniranges )
|
||||
{
|
||||
int i, j, c;
|
||||
CV_Assert( channels != 0 || nimages == dims );
|
||||
@@ -216,7 +216,7 @@ template<typename T>
|
||||
class calcHist1D_Invoker
|
||||
{
|
||||
public:
|
||||
calcHist1D_Invoker( const vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcHist1D_Invoker( const std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Mat& hist, const double* _uniranges, int sz, int dims,
|
||||
Size& imageSize )
|
||||
: mask_(_ptrs[dims]),
|
||||
@@ -288,7 +288,7 @@ template<typename T>
|
||||
class calcHist2D_Invoker
|
||||
{
|
||||
public:
|
||||
calcHist2D_Invoker( const vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcHist2D_Invoker( const std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Mat& hist, const double* _uniranges, const int* size,
|
||||
int dims, Size& imageSize, size_t* hstep )
|
||||
: mask_(_ptrs[dims]),
|
||||
@@ -362,7 +362,7 @@ template<typename T>
|
||||
class calcHist3D_Invoker
|
||||
{
|
||||
public:
|
||||
calcHist3D_Invoker( const vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcHist3D_Invoker( const std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, const double* uniranges, int _dims,
|
||||
size_t* hstep, int* size )
|
||||
: mask_(_ptrs[_dims]),
|
||||
@@ -448,8 +448,8 @@ private:
|
||||
class CalcHist1D_8uInvoker
|
||||
{
|
||||
public:
|
||||
CalcHist1D_8uInvoker( const vector<uchar*>& ptrs, const vector<int>& deltas,
|
||||
Size imsize, Mat& hist, int dims, const vector<size_t>& tab,
|
||||
CalcHist1D_8uInvoker( const std::vector<uchar*>& ptrs, const std::vector<int>& deltas,
|
||||
Size imsize, Mat& hist, int dims, const std::vector<size_t>& tab,
|
||||
tbb::mutex* lock )
|
||||
: mask_(ptrs[dims]),
|
||||
mstep_(deltas[dims*2 + 1]),
|
||||
@@ -569,8 +569,8 @@ private:
|
||||
class CalcHist2D_8uInvoker
|
||||
{
|
||||
public:
|
||||
CalcHist2D_8uInvoker( const vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, int dims, const vector<size_t>& _tab,
|
||||
CalcHist2D_8uInvoker( const std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, int dims, const std::vector<size_t>& _tab,
|
||||
tbb::mutex* lock )
|
||||
: mask_(_ptrs[dims]),
|
||||
mstep_(_deltas[dims*2 + 1]),
|
||||
@@ -654,8 +654,8 @@ private:
|
||||
class CalcHist3D_8uInvoker
|
||||
{
|
||||
public:
|
||||
CalcHist3D_8uInvoker( const vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, int dims, const vector<size_t>& tab )
|
||||
CalcHist3D_8uInvoker( const std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, int dims, const std::vector<size_t>& tab )
|
||||
: mask_(_ptrs[dims]),
|
||||
mstep_(_deltas[dims*2 + 1]),
|
||||
histogramSize_(hist.size.p), histogramType_(hist.type()),
|
||||
@@ -723,8 +723,8 @@ private:
|
||||
};
|
||||
|
||||
static void
|
||||
callCalcHist2D_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, int dims, vector<size_t>& _tab )
|
||||
callCalcHist2D_8u( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, int dims, std::vector<size_t>& _tab )
|
||||
{
|
||||
int grainSize = imsize.height / tbb::task_scheduler_init::default_num_threads();
|
||||
tbb::mutex histogramWriteLock;
|
||||
@@ -734,8 +734,8 @@ callCalcHist2D_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
}
|
||||
|
||||
static void
|
||||
callCalcHist3D_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, int dims, vector<size_t>& _tab )
|
||||
callCalcHist3D_8u( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, int dims, std::vector<size_t>& _tab )
|
||||
{
|
||||
CalcHist3D_8uInvoker body(_ptrs, _deltas, imsize, hist, dims, _tab);
|
||||
parallel_for(BlockedRange(0, imsize.height), body);
|
||||
@@ -743,7 +743,7 @@ callCalcHist3D_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
#endif
|
||||
|
||||
template<typename T> static void
|
||||
calcHist_( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcHist_( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, int dims, const float** _ranges,
|
||||
const double* _uniranges, bool uniform )
|
||||
{
|
||||
@@ -976,7 +976,7 @@ calcHist_( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
|
||||
|
||||
static void
|
||||
calcHist_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcHist_8u( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, Mat& hist, int dims, const float** _ranges,
|
||||
const double* _uniranges, bool uniform )
|
||||
{
|
||||
@@ -986,7 +986,7 @@ calcHist_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
int x;
|
||||
const uchar* mask = _ptrs[dims];
|
||||
int mstep = _deltas[dims*2 + 1];
|
||||
vector<size_t> _tab;
|
||||
std::vector<size_t> _tab;
|
||||
|
||||
calcHistLookupTables_8u( hist, SparseMat(), dims, _ranges, _uniranges, uniform, false, _tab );
|
||||
const size_t* tab = &_tab[0];
|
||||
@@ -1189,9 +1189,9 @@ void cv::calcHist( const Mat* images, int nimages, const int* channels,
|
||||
else
|
||||
hist.convertTo(ihist, CV_32S);
|
||||
|
||||
vector<uchar*> ptrs;
|
||||
vector<int> deltas;
|
||||
vector<double> uniranges;
|
||||
std::vector<uchar*> ptrs;
|
||||
std::vector<int> deltas;
|
||||
std::vector<double> uniranges;
|
||||
Size imsize;
|
||||
|
||||
CV_Assert( !mask.data || mask.type() == CV_8UC1 );
|
||||
@@ -1218,7 +1218,7 @@ namespace cv
|
||||
{
|
||||
|
||||
template<typename T> static void
|
||||
calcSparseHist_( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcSparseHist_( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, SparseMat& hist, int dims, const float** _ranges,
|
||||
const double* _uniranges, bool uniform )
|
||||
{
|
||||
@@ -1302,7 +1302,7 @@ calcSparseHist_( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
|
||||
|
||||
static void
|
||||
calcSparseHist_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcSparseHist_8u( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, SparseMat& hist, int dims, const float** _ranges,
|
||||
const double* _uniranges, bool uniform )
|
||||
{
|
||||
@@ -1312,7 +1312,7 @@ calcSparseHist_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
const uchar* mask = _ptrs[dims];
|
||||
int mstep = _deltas[dims*2 + 1];
|
||||
int idx[CV_MAX_DIM];
|
||||
vector<size_t> _tab;
|
||||
std::vector<size_t> _tab;
|
||||
|
||||
calcHistLookupTables_8u( Mat(), hist, dims, _ranges, _uniranges, uniform, true, _tab );
|
||||
const size_t* tab = &_tab[0];
|
||||
@@ -1362,9 +1362,9 @@ static void calcHist( const Mat* images, int nimages, const int* channels,
|
||||
}
|
||||
}
|
||||
|
||||
vector<uchar*> ptrs;
|
||||
vector<int> deltas;
|
||||
vector<double> uniranges;
|
||||
std::vector<uchar*> ptrs;
|
||||
std::vector<int> deltas;
|
||||
std::vector<double> uniranges;
|
||||
Size imsize;
|
||||
|
||||
CV_Assert( !mask.data || mask.type() == CV_8UC1 );
|
||||
@@ -1405,10 +1405,10 @@ void cv::calcHist( const Mat* images, int nimages, const int* channels,
|
||||
}
|
||||
|
||||
|
||||
void cv::calcHist( InputArrayOfArrays images, const vector<int>& channels,
|
||||
void cv::calcHist( InputArrayOfArrays images, const std::vector<int>& channels,
|
||||
InputArray mask, OutputArray hist,
|
||||
const vector<int>& histSize,
|
||||
const vector<float>& ranges,
|
||||
const std::vector<int>& histSize,
|
||||
const std::vector<float>& ranges,
|
||||
bool accumulate )
|
||||
{
|
||||
int i, dims = (int)histSize.size(), rsz = (int)ranges.size(), csz = (int)channels.size();
|
||||
@@ -1440,7 +1440,7 @@ namespace cv
|
||||
{
|
||||
|
||||
template<typename T, typename BT> static void
|
||||
calcBackProj_( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcBackProj_( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, const Mat& hist, int dims, const float** _ranges,
|
||||
const double* _uniranges, float scale, bool uniform )
|
||||
{
|
||||
@@ -1605,7 +1605,7 @@ calcBackProj_( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
|
||||
|
||||
static void
|
||||
calcBackProj_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcBackProj_8u( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, const Mat& hist, int dims, const float** _ranges,
|
||||
const double* _uniranges, float scale, bool uniform )
|
||||
{
|
||||
@@ -1615,7 +1615,7 @@ calcBackProj_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
int i, x;
|
||||
uchar* bproj = _ptrs[dims];
|
||||
int bpstep = _deltas[dims*2 + 1];
|
||||
vector<size_t> _tab;
|
||||
std::vector<size_t> _tab;
|
||||
|
||||
calcHistLookupTables_8u( hist, SparseMat(), dims, _ranges, _uniranges, uniform, false, _tab );
|
||||
const size_t* tab = &_tab[0];
|
||||
@@ -1733,9 +1733,9 @@ void cv::calcBackProject( const Mat* images, int nimages, const int* channels,
|
||||
const float** ranges, double scale, bool uniform )
|
||||
{
|
||||
Mat hist = _hist.getMat();
|
||||
vector<uchar*> ptrs;
|
||||
vector<int> deltas;
|
||||
vector<double> uniranges;
|
||||
std::vector<uchar*> ptrs;
|
||||
std::vector<int> deltas;
|
||||
std::vector<double> uniranges;
|
||||
Size imsize;
|
||||
int dims = hist.dims == 2 && hist.size[1] == 1 ? 1 : hist.dims;
|
||||
|
||||
@@ -1762,7 +1762,7 @@ namespace cv
|
||||
{
|
||||
|
||||
template<typename T, typename BT> static void
|
||||
calcSparseBackProj_( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcSparseBackProj_( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, const SparseMat& hist, int dims, const float** _ranges,
|
||||
const double* _uniranges, float scale, bool uniform )
|
||||
{
|
||||
@@ -1847,7 +1847,7 @@ calcSparseBackProj_( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
|
||||
|
||||
static void
|
||||
calcSparseBackProj_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
calcSparseBackProj_8u( std::vector<uchar*>& _ptrs, const std::vector<int>& _deltas,
|
||||
Size imsize, const SparseMat& hist, int dims, const float** _ranges,
|
||||
const double* _uniranges, float scale, bool uniform )
|
||||
{
|
||||
@@ -1856,7 +1856,7 @@ calcSparseBackProj_8u( vector<uchar*>& _ptrs, const vector<int>& _deltas,
|
||||
int i, x;
|
||||
uchar* bproj = _ptrs[dims];
|
||||
int bpstep = _deltas[dims*2 + 1];
|
||||
vector<size_t> _tab;
|
||||
std::vector<size_t> _tab;
|
||||
int idx[CV_MAX_DIM];
|
||||
|
||||
calcHistLookupTables_8u( Mat(), hist, dims, _ranges, _uniranges, uniform, true, _tab );
|
||||
@@ -1895,9 +1895,9 @@ void cv::calcBackProject( const Mat* images, int nimages, const int* channels,
|
||||
const SparseMat& hist, OutputArray _backProject,
|
||||
const float** ranges, double scale, bool uniform )
|
||||
{
|
||||
vector<uchar*> ptrs;
|
||||
vector<int> deltas;
|
||||
vector<double> uniranges;
|
||||
std::vector<uchar*> ptrs;
|
||||
std::vector<int> deltas;
|
||||
std::vector<double> uniranges;
|
||||
Size imsize;
|
||||
int dims = hist.dims();
|
||||
|
||||
@@ -1924,9 +1924,9 @@ void cv::calcBackProject( const Mat* images, int nimages, const int* channels,
|
||||
}
|
||||
|
||||
|
||||
void cv::calcBackProject( InputArrayOfArrays images, const vector<int>& channels,
|
||||
void cv::calcBackProject( InputArrayOfArrays images, const std::vector<int>& channels,
|
||||
InputArray hist, OutputArray dst,
|
||||
const vector<float>& ranges,
|
||||
const std::vector<float>& ranges,
|
||||
double scale )
|
||||
{
|
||||
Mat H0 = hist.getMat(), H;
|
||||
@@ -2734,7 +2734,7 @@ cvCalcArrHist( CvArr** img, CvHistogram* hist, int accumulate, const CvArr* mask
|
||||
int i, dims = cvGetDims( hist->bins, size);
|
||||
bool uniform = CV_IS_UNIFORM_HIST(hist);
|
||||
|
||||
cv::vector<cv::Mat> images(dims);
|
||||
std::vector<cv::Mat> images(dims);
|
||||
for( i = 0; i < dims; i++ )
|
||||
images[i] = cv::cvarrToMat(img[i]);
|
||||
|
||||
@@ -2810,7 +2810,7 @@ cvCalcArrBackProject( CvArr** img, CvArr* dst, const CvHistogram* hist )
|
||||
}
|
||||
}
|
||||
|
||||
cv::vector<cv::Mat> images(dims);
|
||||
std::vector<cv::Mat> images(dims);
|
||||
for( i = 0; i < dims; i++ )
|
||||
images[i] = cv::cvarrToMat(img[i]);
|
||||
|
||||
|
@@ -60,7 +60,7 @@ struct hough_cmp_gt
|
||||
const int* aux;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Here image is an input raster;
|
||||
step is it's step; size characterizes it's ROI;
|
||||
@@ -72,7 +72,7 @@ Functions return the actual number of found lines.
|
||||
*/
|
||||
static void
|
||||
HoughLinesStandard( const Mat& img, float rho, float theta,
|
||||
int threshold, vector<Vec2f>& lines, int linesMax )
|
||||
int threshold, std::vector<Vec2f>& lines, int linesMax )
|
||||
{
|
||||
int i, j;
|
||||
float irho = 1 / rho;
|
||||
@@ -88,7 +88,7 @@ HoughLinesStandard( const Mat& img, float rho, float theta,
|
||||
int numrho = cvRound(((width + height) * 2 + 1) / rho);
|
||||
|
||||
AutoBuffer<int> _accum((numangle+2) * (numrho+2));
|
||||
vector<int> _sort_buf;
|
||||
std::vector<int> _sort_buf;
|
||||
AutoBuffer<float> _tabSin(numangle);
|
||||
AutoBuffer<float> _tabCos(numangle);
|
||||
int *accum = _accum;
|
||||
@@ -131,7 +131,7 @@ HoughLinesStandard( const Mat& img, float rho, float theta,
|
||||
cv::sort(_sort_buf, hough_cmp_gt(accum));
|
||||
|
||||
// stage 4. store the first min(total,linesMax) lines to the output buffer
|
||||
linesMax = min(linesMax, (int)_sort_buf.size());
|
||||
linesMax = std::min(linesMax, (int)_sort_buf.size());
|
||||
double scale = 1./(numrho+2);
|
||||
for( i = 0; i < linesMax; i++ )
|
||||
{
|
||||
@@ -153,17 +153,17 @@ struct hough_index
|
||||
hough_index() : value(0), rho(0.f), theta(0.f) {}
|
||||
hough_index(int _val, float _rho, float _theta)
|
||||
: value(_val), rho(_rho), theta(_theta) {}
|
||||
|
||||
|
||||
int value;
|
||||
float rho, theta;
|
||||
};
|
||||
|
||||
|
||||
|
||||
static void
|
||||
HoughLinesSDiv( const Mat& img,
|
||||
float rho, float theta, int threshold,
|
||||
int srn, int stn,
|
||||
vector<Vec2f>& lines, int linesMax )
|
||||
std::vector<Vec2f>& lines, int linesMax )
|
||||
{
|
||||
#define _POINT(row, column)\
|
||||
(image_src[(row)*step+(column)])
|
||||
@@ -183,7 +183,7 @@ HoughLinesSDiv( const Mat& img,
|
||||
int count;
|
||||
int cmax = 0;
|
||||
|
||||
vector<hough_index> lst;
|
||||
std::vector<hough_index> lst;
|
||||
|
||||
CV_Assert( img.type() == CV_8UC1 );
|
||||
CV_Assert( linesMax > 0 && rho > 0 && theta > 0 );
|
||||
@@ -202,19 +202,19 @@ HoughLinesSDiv( const Mat& img,
|
||||
float isrho = 1 / srho;
|
||||
float istheta = 1 / stheta;
|
||||
|
||||
int rn = cvFloor( sqrt( (double)w * w + (double)h * h ) * irho );
|
||||
int rn = cvFloor( std::sqrt( (double)w * w + (double)h * h ) * irho );
|
||||
int tn = cvFloor( 2 * CV_PI * itheta );
|
||||
|
||||
lst.push_back(hough_index(threshold, -1.f, 0.f));
|
||||
|
||||
// Precalculate sin table
|
||||
vector<float> _sinTable( 5 * tn * stn );
|
||||
std::vector<float> _sinTable( 5 * tn * stn );
|
||||
float* sinTable = &_sinTable[0];
|
||||
|
||||
for( index = 0; index < 5 * tn * stn; index++ )
|
||||
sinTable[index] = (float)cos( stheta * index * 0.2f );
|
||||
|
||||
vector<uchar> _caccum(rn * tn, (uchar)0);
|
||||
std::vector<uchar> _caccum(rn * tn, (uchar)0);
|
||||
uchar* caccum = &_caccum[0];
|
||||
|
||||
// Counting all feature pixels
|
||||
@@ -222,7 +222,7 @@ HoughLinesSDiv( const Mat& img,
|
||||
for( col = 0; col < w; col++ )
|
||||
fn += _POINT( row, col ) != 0;
|
||||
|
||||
vector<int> _x(fn), _y(fn);
|
||||
std::vector<int> _x(fn), _y(fn);
|
||||
int* x = &_x[0], *y = &_y[0];
|
||||
|
||||
// Full Hough Transform (it's accumulator update part)
|
||||
@@ -250,7 +250,7 @@ HoughLinesSDiv( const Mat& img,
|
||||
|
||||
/* Update the accumulator */
|
||||
t = (float) fabs( cvFastArctan( yc, xc ) * d2r );
|
||||
r = (float) sqrt( (double)xc * xc + (double)yc * yc );
|
||||
r = (float) std::sqrt( (double)xc * xc + (double)yc * yc );
|
||||
r0 = r * irho;
|
||||
ti0 = cvFloor( (t + CV_PI*0.5) * itheta );
|
||||
|
||||
@@ -294,7 +294,7 @@ HoughLinesSDiv( const Mat& img,
|
||||
return;
|
||||
}
|
||||
|
||||
vector<uchar> _buffer(srn * stn + 2);
|
||||
std::vector<uchar> _buffer(srn * stn + 2);
|
||||
uchar* buffer = &_buffer[0];
|
||||
uchar* mcaccum = buffer + 1;
|
||||
|
||||
@@ -318,7 +318,7 @@ HoughLinesSDiv( const Mat& img,
|
||||
|
||||
// Update the accumulator
|
||||
t = (float) fabs( cvFastArctan( yc, xc ) * d2r );
|
||||
r = (float) sqrt( (double)xc * xc + (double)yc * yc ) * isrho;
|
||||
r = (float) std::sqrt( (double)xc * xc + (double)yc * yc ) * isrho;
|
||||
ti0 = cvFloor( (t + CV_PI * 0.5) * istheta );
|
||||
ti2 = (ti * stn - ti0) * 5;
|
||||
r0 = (float) ri *srn;
|
||||
@@ -379,7 +379,7 @@ static void
|
||||
HoughLinesProbabilistic( Mat& image,
|
||||
float rho, float theta, int threshold,
|
||||
int lineLength, int lineGap,
|
||||
vector<Vec4i>& lines, int linesMax )
|
||||
std::vector<Vec4i>& lines, int linesMax )
|
||||
{
|
||||
Point pt;
|
||||
float irho = 1 / rho;
|
||||
@@ -395,7 +395,7 @@ HoughLinesProbabilistic( Mat& image,
|
||||
|
||||
Mat accum = Mat::zeros( numangle, numrho, CV_32SC1 );
|
||||
Mat mask( height, width, CV_8UC1 );
|
||||
vector<float> trigtab(numangle*2);
|
||||
std::vector<float> trigtab(numangle*2);
|
||||
|
||||
for( int n = 0; n < numangle; n++ )
|
||||
{
|
||||
@@ -404,7 +404,7 @@ HoughLinesProbabilistic( Mat& image,
|
||||
}
|
||||
const float* ttab = &trigtab[0];
|
||||
uchar* mdata0 = mask.data;
|
||||
vector<Point> nzloc;
|
||||
std::vector<Point> nzloc;
|
||||
|
||||
// stage 1. collect non-zero image points
|
||||
for( pt.y = 0; pt.y < height; pt.y++ )
|
||||
@@ -601,7 +601,7 @@ void cv::HoughLines( InputArray _image, OutputArray _lines,
|
||||
double srn, double stn )
|
||||
{
|
||||
Mat image = _image.getMat();
|
||||
vector<Vec2f> lines;
|
||||
std::vector<Vec2f> lines;
|
||||
|
||||
if( srn == 0 && stn == 0 )
|
||||
HoughLinesStandard(image, (float)rho, (float)theta, threshold, lines, INT_MAX);
|
||||
@@ -617,7 +617,7 @@ void cv::HoughLinesP(InputArray _image, OutputArray _lines,
|
||||
double minLineLength, double maxGap )
|
||||
{
|
||||
Mat image = _image.getMat();
|
||||
vector<Vec4i> lines;
|
||||
std::vector<Vec4i> lines;
|
||||
HoughLinesProbabilistic(image, (float)rho, (float)theta, threshold, cvRound(minLineLength), cvRound(maxGap), lines, INT_MAX);
|
||||
Mat(lines).copyTo(_lines);
|
||||
}
|
||||
@@ -806,7 +806,7 @@ icvHoughCirclesGradient( CvMat* img, float dp, float min_dist,
|
||||
if( !edges_row[x] || (vx == 0 && vy == 0) )
|
||||
continue;
|
||||
|
||||
float mag = sqrt(vx*vx+vy*vy);
|
||||
float mag = std::sqrt(vx*vx+vy*vy);
|
||||
assert( mag >= 1 );
|
||||
sx = cvRound((vx*idp)*ONE/mag);
|
||||
sy = cvRound((vy*idp)*ONE/mag);
|
||||
|
@@ -1763,7 +1763,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec
|
||||
{
|
||||
double fsx1 = dx * scale;
|
||||
double fsx2 = fsx1 + scale;
|
||||
double cellWidth = min(scale, ssize - fsx1);
|
||||
double cellWidth = std::min(scale, ssize - fsx1);
|
||||
|
||||
int sx1 = cvCeil(fsx1), sx2 = cvFloor(fsx2);
|
||||
|
||||
@@ -1791,7 +1791,7 @@ static int computeResizeAreaTab( int ssize, int dsize, int cn, double scale, Dec
|
||||
assert( k < ssize*2 );
|
||||
tab[k].di = dx * cn;
|
||||
tab[k].si = sx2 * cn;
|
||||
tab[k++].alpha = (float)(min(min(fsx2 - sx2, 1.), cellWidth) / cellWidth);
|
||||
tab[k++].alpha = (float)(std::min(std::min(fsx2 - sx2, 1.), cellWidth) / cellWidth);
|
||||
}
|
||||
}
|
||||
return k;
|
||||
@@ -4009,7 +4009,7 @@ cvLogPolar( const CvArr* srcarr, CvArr* dstarr,
|
||||
double xx = bufx.data.fl[x];
|
||||
double yy = bufy.data.fl[x];
|
||||
|
||||
double p = log(sqrt(xx*xx + yy*yy) + 1.)*M;
|
||||
double p = log(std::sqrt(xx*xx + yy*yy) + 1.)*M;
|
||||
double a = atan2(yy,xx);
|
||||
if( a < 0 )
|
||||
a = 2*CV_PI + a;
|
||||
|
@@ -189,7 +189,7 @@ static void fitLine3D_wods( const Point3f * points, int count, float *weights, f
|
||||
i = evl[0] < evl[1] ? (evl[0] < evl[2] ? 0 : 2) : (evl[1] < evl[2] ? 1 : 2);
|
||||
|
||||
v = &evc[i * 3];
|
||||
n = (float) sqrt( (double)v[0] * v[0] + (double)v[1] * v[1] + (double)v[2] * v[2] );
|
||||
n = (float) std::sqrt( (double)v[0] * v[0] + (double)v[1] * v[1] + (double)v[2] * v[2] );
|
||||
n = (float)MAX(n, eps);
|
||||
line[0] = v[0] / n;
|
||||
line[1] = v[1] / n;
|
||||
@@ -240,7 +240,7 @@ static double calcDist3D( const Point3f* points, int count, float *_line, float
|
||||
p2 = vz * x - vx * z;
|
||||
p3 = vx * y - vy * x;
|
||||
|
||||
dist[j] = (float) sqrt( p1*p1 + p2*p2 + p3*p3 );
|
||||
dist[j] = (float) std::sqrt( p1*p1 + p2*p2 + p3*p3 );
|
||||
sum_dist += dist[j];
|
||||
}
|
||||
|
||||
@@ -264,7 +264,7 @@ static void weightL12( float *d, int count, float *w )
|
||||
|
||||
for( i = 0; i < count; i++ )
|
||||
{
|
||||
w[i] = 1.0f / (float) sqrt( 1 + (double) (d[i] * d[i] * 0.5) );
|
||||
w[i] = 1.0f / (float) std::sqrt( 1 + (double) (d[i] * d[i] * 0.5) );
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -790,7 +790,7 @@ template<class Op, class VecOp> struct MorphFilter : BaseFilter
|
||||
ksize = _kernel.size();
|
||||
CV_Assert( _kernel.type() == CV_8U );
|
||||
|
||||
vector<uchar> coeffs; // we do not really the values of non-zero
|
||||
std::vector<uchar> coeffs; // we do not really the values of non-zero
|
||||
// kernel elements, just their locations
|
||||
preprocess2DKernel( _kernel, coords, coeffs );
|
||||
ptrs.resize( coords.size() );
|
||||
@@ -839,8 +839,8 @@ template<class Op, class VecOp> struct MorphFilter : BaseFilter
|
||||
}
|
||||
}
|
||||
|
||||
vector<Point> coords;
|
||||
vector<uchar*> ptrs;
|
||||
std::vector<Point> coords;
|
||||
std::vector<uchar*> ptrs;
|
||||
VecOp vecOp;
|
||||
};
|
||||
|
||||
@@ -1104,8 +1104,8 @@ public:
|
||||
|
||||
void operator () ( const BlockedRange& range ) const
|
||||
{
|
||||
int row0 = min(cvRound(range.begin() * src.rows / nStripes), src.rows);
|
||||
int row1 = min(cvRound(range.end() * src.rows / nStripes), src.rows);
|
||||
int row0 = std::min(cvRound(range.begin() * src.rows / nStripes), src.rows);
|
||||
int row1 = std::min(cvRound(range.end() * src.rows / nStripes), src.rows);
|
||||
|
||||
/*if(0)
|
||||
printf("Size = (%d, %d), range[%d,%d), row0 = %d, row1 = %d\n",
|
||||
|
@@ -359,7 +359,7 @@ static void fftShift(InputOutputArray _out)
|
||||
return;
|
||||
}
|
||||
|
||||
vector<Mat> planes;
|
||||
std::vector<Mat> planes;
|
||||
split(out, planes);
|
||||
|
||||
int xMid = out.cols >> 1;
|
||||
|
@@ -91,7 +91,7 @@ static inline Point normalizeAnchor( Point anchor, Size ksize )
|
||||
return anchor;
|
||||
}
|
||||
|
||||
void preprocess2DKernel( const Mat& kernel, vector<Point>& coords, vector<uchar>& coeffs );
|
||||
void preprocess2DKernel( const Mat& kernel, std::vector<Point>& coords, std::vector<uchar>& coeffs );
|
||||
void crossCorr( const Mat& src, const Mat& templ, Mat& dst,
|
||||
Size corrsize, int ctype,
|
||||
Point anchor=Point(0,0), double delta=0,
|
||||
|
@@ -138,7 +138,7 @@ static void rotatingCalipers( const Point2f* points, int n, int mode, float* out
|
||||
|
||||
vect[i].x = (float)dx;
|
||||
vect[i].y = (float)dy;
|
||||
inv_vect_length[i] = (float)(1./sqrt(dx*dx + dy*dy));
|
||||
inv_vect_length[i] = (float)(1./std::sqrt(dx*dx + dy*dy));
|
||||
|
||||
pt0 = pt;
|
||||
}
|
||||
@@ -321,10 +321,10 @@ static void rotatingCalipers( const Point2f* points, int n, int mode, float* out
|
||||
|
||||
out[0] = px;
|
||||
out[1] = py;
|
||||
|
||||
|
||||
out[2] = A1 * buf[2];
|
||||
out[3] = B1 * buf[2];
|
||||
|
||||
|
||||
out[4] = A2 * buf[4];
|
||||
out[5] = B2 * buf[4];
|
||||
}
|
||||
@@ -336,7 +336,7 @@ static void rotatingCalipers( const Point2f* points, int n, int mode, float* out
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -345,35 +345,35 @@ cv::RotatedRect cv::minAreaRect( InputArray _points )
|
||||
Mat hull;
|
||||
Point2f out[3];
|
||||
RotatedRect box;
|
||||
|
||||
|
||||
convexHull(_points, hull, true, true);
|
||||
|
||||
|
||||
if( hull.depth() != CV_32F )
|
||||
{
|
||||
Mat temp;
|
||||
hull.convertTo(temp, CV_32F);
|
||||
hull = temp;
|
||||
}
|
||||
|
||||
|
||||
int n = hull.checkVector(2);
|
||||
const Point2f* hpoints = (const Point2f*)hull.data;
|
||||
|
||||
|
||||
if( n > 2 )
|
||||
{
|
||||
rotatingCalipers( hpoints, n, CALIPERS_MINAREARECT, (float*)out );
|
||||
box.center.x = out[0].x + (out[1].x + out[2].x)*0.5f;
|
||||
box.center.y = out[0].y + (out[1].y + out[2].y)*0.5f;
|
||||
box.size.width = (float)sqrt((double)out[1].x*out[1].x + (double)out[1].y*out[1].y);
|
||||
box.size.height = (float)sqrt((double)out[2].x*out[2].x + (double)out[2].y*out[2].y);
|
||||
box.size.width = (float)std::sqrt((double)out[1].x*out[1].x + (double)out[1].y*out[1].y);
|
||||
box.size.height = (float)std::sqrt((double)out[2].x*out[2].x + (double)out[2].y*out[2].y);
|
||||
box.angle = (float)atan2( (double)out[1].y, (double)out[1].x );
|
||||
}
|
||||
else if( n == 2 )
|
||||
{
|
||||
box.center.x = (hpoints[0].x + hpoints[1].x)*0.5f;
|
||||
box.center.y = (hpoints[0].y + hpoints[1].y)*0.5f;
|
||||
double dx = hpoints[1].x - hpoints[0].x;
|
||||
double dx = hpoints[1].x - hpoints[0].x;
|
||||
double dy = hpoints[1].y - hpoints[0].y;
|
||||
box.size.width = (float)sqrt(dx*dx + dy*dy);
|
||||
box.size.width = (float)std::sqrt(dx*dx + dy*dy);
|
||||
box.size.height = 0;
|
||||
box.angle = (float)atan2( dy, dx );
|
||||
}
|
||||
@@ -382,7 +382,7 @@ cv::RotatedRect cv::minAreaRect( InputArray _points )
|
||||
if( n == 1 )
|
||||
box.center = hpoints[0];
|
||||
}
|
||||
|
||||
|
||||
box.angle = (float)(box.angle*180/CV_PI);
|
||||
return box;
|
||||
}
|
||||
|
@@ -64,7 +64,7 @@ struct WSQueue
|
||||
|
||||
|
||||
static int
|
||||
allocWSNodes( vector<WSNode>& storage )
|
||||
allocWSNodes( std::vector<WSNode>& storage )
|
||||
{
|
||||
int sz = (int)storage.size();
|
||||
int newsz = MAX(128, sz*3/2);
|
||||
@@ -93,7 +93,7 @@ void cv::watershed( InputArray _src, InputOutputArray _markers )
|
||||
Mat src = _src.getMat(), dst = _markers.getMat();
|
||||
Size size = src.size();
|
||||
|
||||
vector<WSNode> storage;
|
||||
std::vector<WSNode> storage;
|
||||
int free_node = 0, node;
|
||||
WSQueue q[NQ];
|
||||
int active_queue;
|
||||
|
@@ -284,7 +284,7 @@ void cv::minEnclosingCircle( InputArray _points, Point2f& _center, float& _radiu
|
||||
radius = MAX(radius, t);
|
||||
}
|
||||
|
||||
radius = (float)(sqrt(radius)*(1 + eps));
|
||||
radius = (float)(std::sqrt(radius)*(1 + eps));
|
||||
}
|
||||
|
||||
_center = center;
|
||||
@@ -428,7 +428,7 @@ cv::RotatedRect cv::fitEllipse( InputArray _points )
|
||||
bd[0] = gfp[3];
|
||||
bd[1] = gfp[4];
|
||||
solve( A, b, x, DECOMP_SVD );
|
||||
|
||||
|
||||
// re-fit for parameters A - C with those center coordinates
|
||||
A = Mat( n, 3, CV_64F, Ad );
|
||||
b = Mat( n, 1, CV_64F, bd );
|
||||
@@ -443,7 +443,7 @@ cv::RotatedRect cv::fitEllipse( InputArray _points )
|
||||
Ad[i * 3 + 2] = (p.x - rp[0]) * (p.y - rp[1]);
|
||||
}
|
||||
solve(A, b, x, DECOMP_SVD);
|
||||
|
||||
|
||||
// store angle and radii
|
||||
rp[4] = -0.5 * atan2(gfp[2], gfp[1] - gfp[0]); // convert from APP angle usage
|
||||
t = sin(-2.0 * rp[4]);
|
||||
@@ -453,11 +453,11 @@ cv::RotatedRect cv::fitEllipse( InputArray _points )
|
||||
t = gfp[1] - gfp[0];
|
||||
rp[2] = fabs(gfp[0] + gfp[1] - t);
|
||||
if( rp[2] > min_eps )
|
||||
rp[2] = sqrt(2.0 / rp[2]);
|
||||
rp[2] = std::sqrt(2.0 / rp[2]);
|
||||
rp[3] = fabs(gfp[0] + gfp[1] + t);
|
||||
if( rp[3] > min_eps )
|
||||
rp[3] = sqrt(2.0 / rp[3]);
|
||||
|
||||
rp[3] = std::sqrt(2.0 / rp[3]);
|
||||
|
||||
box.center.x = (float)rp[0] + c.x;
|
||||
box.center.y = (float)rp[1] + c.y;
|
||||
box.size.width = (float)(rp[2]*2);
|
||||
@@ -472,7 +472,7 @@ cv::RotatedRect cv::fitEllipse( InputArray _points )
|
||||
box.angle += 360;
|
||||
if( box.angle > 360 )
|
||||
box.angle -= 360;
|
||||
|
||||
|
||||
return box;
|
||||
}
|
||||
|
||||
@@ -596,7 +596,7 @@ static Rect pointSetBoundingRect( const Mat& points )
|
||||
v.i = CV_TOGGLE_FLT(ymax); ymax = cvFloor(v.f);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return Rect(xmin, ymin, xmax - xmin + 1, ymax - ymin + 1);
|
||||
}
|
||||
|
||||
@@ -688,7 +688,7 @@ static Rect maskBoundingRect( const Mat& img )
|
||||
ymax = i;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if( xmin >= size.width )
|
||||
xmin = ymin = 0;
|
||||
return Rect(xmin, ymin, xmax - xmin + 1, ymax - ymin + 1);
|
||||
@@ -1029,7 +1029,7 @@ cvArcLength( const void *array, CvSlice slice, int is_closed )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return perimeter;
|
||||
}
|
||||
|
||||
|
@@ -193,7 +193,7 @@ template<typename ST, typename T> struct ColumnSum : public BaseColumnFilter
|
||||
|
||||
double scale;
|
||||
int sumCount;
|
||||
vector<ST> sum;
|
||||
std::vector<ST> sum;
|
||||
};
|
||||
|
||||
|
||||
@@ -335,7 +335,7 @@ template<> struct ColumnSum<int, uchar> : public BaseColumnFilter
|
||||
|
||||
double scale;
|
||||
int sumCount;
|
||||
vector<int> sum;
|
||||
std::vector<int> sum;
|
||||
};
|
||||
|
||||
template<> struct ColumnSum<int, short> : public BaseColumnFilter
|
||||
@@ -472,7 +472,7 @@ template<> struct ColumnSum<int, short> : public BaseColumnFilter
|
||||
|
||||
double scale;
|
||||
int sumCount;
|
||||
vector<int> sum;
|
||||
std::vector<int> sum;
|
||||
};
|
||||
|
||||
|
||||
@@ -607,7 +607,7 @@ template<> struct ColumnSum<int, ushort> : public BaseColumnFilter
|
||||
|
||||
double scale;
|
||||
int sumCount;
|
||||
vector<int> sum;
|
||||
std::vector<int> sum;
|
||||
};
|
||||
|
||||
|
||||
@@ -957,8 +957,8 @@ medianBlur_8u_O1( const Mat& _src, Mat& _dst, int ksize )
|
||||
|
||||
int STRIPE_SIZE = std::min( _dst.cols, 512/cn );
|
||||
|
||||
vector<HT> _h_coarse(1 * 16 * (STRIPE_SIZE + 2*r) * cn + 16);
|
||||
vector<HT> _h_fine(16 * 16 * (STRIPE_SIZE + 2*r) * cn + 16);
|
||||
std::vector<HT> _h_coarse(1 * 16 * (STRIPE_SIZE + 2*r) * cn + 16);
|
||||
std::vector<HT> _h_fine(16 * 16 * (STRIPE_SIZE + 2*r) * cn + 16);
|
||||
HT* h_coarse = alignPtr(&_h_coarse[0], 16);
|
||||
HT* h_fine = alignPtr(&_h_fine[0], 16);
|
||||
#if MEDIAN_HAVE_SIMD
|
||||
@@ -1891,9 +1891,9 @@ bilateralFilter_8u( const Mat& src, Mat& dst, int d,
|
||||
Mat temp;
|
||||
copyMakeBorder( src, temp, radius, radius, radius, radius, borderType );
|
||||
|
||||
vector<float> _color_weight(cn*256);
|
||||
vector<float> _space_weight(d*d);
|
||||
vector<int> _space_ofs(d*d);
|
||||
std::vector<float> _color_weight(cn*256);
|
||||
std::vector<float> _space_weight(d*d);
|
||||
std::vector<int> _space_ofs(d*d);
|
||||
float* color_weight = &_color_weight[0];
|
||||
float* space_weight = &_space_weight[0];
|
||||
int* space_ofs = &_space_ofs[0];
|
||||
@@ -2149,15 +2149,15 @@ bilateralFilter_32f( const Mat& src, Mat& dst, int d,
|
||||
patchNaNs( temp, insteadNaNValue ); // this replacement of NaNs makes the assumption that depth values are nonnegative
|
||||
// TODO: make insteadNaNValue avalible in the outside function interface to control the cases breaking the assumption
|
||||
// allocate lookup tables
|
||||
vector<float> _space_weight(d*d);
|
||||
vector<int> _space_ofs(d*d);
|
||||
std::vector<float> _space_weight(d*d);
|
||||
std::vector<int> _space_ofs(d*d);
|
||||
float* space_weight = &_space_weight[0];
|
||||
int* space_ofs = &_space_ofs[0];
|
||||
|
||||
// assign a length which is slightly more than needed
|
||||
len = (float)(maxValSrc - minValSrc) * cn;
|
||||
kExpNumBins = kExpNumBinsPerChannel * cn;
|
||||
vector<float> _expLUT(kExpNumBins+2);
|
||||
std::vector<float> _expLUT(kExpNumBins+2);
|
||||
float* expLUT = &_expLUT[0];
|
||||
|
||||
scale_index = kExpNumBins/len;
|
||||
|
@@ -477,7 +477,7 @@ int Subdiv2D::insert(Point2f pt)
|
||||
return curr_point;
|
||||
}
|
||||
|
||||
void Subdiv2D::insert(const vector<Point2f>& ptvec)
|
||||
void Subdiv2D::insert(const std::vector<Point2f>& ptvec)
|
||||
{
|
||||
for( size_t i = 0; i < ptvec.size(); i++ )
|
||||
insert(ptvec[i]);
|
||||
@@ -706,7 +706,7 @@ int Subdiv2D::findNearest(Point2f pt, Point2f* nearestPt)
|
||||
return vertex;
|
||||
}
|
||||
|
||||
void Subdiv2D::getEdgeList(vector<Vec4f>& edgeList) const
|
||||
void Subdiv2D::getEdgeList(std::vector<Vec4f>& edgeList) const
|
||||
{
|
||||
edgeList.clear();
|
||||
|
||||
@@ -723,11 +723,11 @@ void Subdiv2D::getEdgeList(vector<Vec4f>& edgeList) const
|
||||
}
|
||||
}
|
||||
|
||||
void Subdiv2D::getTriangleList(vector<Vec6f>& triangleList) const
|
||||
void Subdiv2D::getTriangleList(std::vector<Vec6f>& triangleList) const
|
||||
{
|
||||
triangleList.clear();
|
||||
int i, total = (int)(qedges.size()*4);
|
||||
vector<bool> edgemask(total, false);
|
||||
std::vector<bool> edgemask(total, false);
|
||||
|
||||
for( i = 4; i < total; i += 2 )
|
||||
{
|
||||
@@ -747,15 +747,15 @@ void Subdiv2D::getTriangleList(vector<Vec6f>& triangleList) const
|
||||
}
|
||||
}
|
||||
|
||||
void Subdiv2D::getVoronoiFacetList(const vector<int>& idx,
|
||||
CV_OUT vector<vector<Point2f> >& facetList,
|
||||
CV_OUT vector<Point2f>& facetCenters)
|
||||
void Subdiv2D::getVoronoiFacetList(const std::vector<int>& idx,
|
||||
CV_OUT std::vector<std::vector<Point2f> >& facetList,
|
||||
CV_OUT std::vector<Point2f>& facetCenters)
|
||||
{
|
||||
calcVoronoi();
|
||||
facetList.clear();
|
||||
facetCenters.clear();
|
||||
|
||||
vector<Point2f> buf;
|
||||
std::vector<Point2f> buf;
|
||||
|
||||
size_t i, total;
|
||||
if( idx.empty() )
|
||||
|
@@ -300,8 +300,8 @@ void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result,
|
||||
}
|
||||
|
||||
templSum2 /= invArea;
|
||||
templNorm = sqrt(templNorm);
|
||||
templNorm /= sqrt(invArea); // care of accuracy here
|
||||
templNorm = std::sqrt(templNorm);
|
||||
templNorm /= std::sqrt(invArea); // care of accuracy here
|
||||
|
||||
q0 = (double*)sqsum.data;
|
||||
q1 = q0 + templ.cols*cn;
|
||||
@@ -359,7 +359,7 @@ void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result,
|
||||
|
||||
if( isNormed )
|
||||
{
|
||||
t = sqrt(MAX(wndSum2 - wndMean2,0))*templNorm;
|
||||
t = std::sqrt(MAX(wndSum2 - wndMean2,0))*templNorm;
|
||||
if( fabs(num) < t )
|
||||
num /= t;
|
||||
else if( fabs(num) < t*1.125 )
|
||||
|
@@ -415,7 +415,7 @@ static Point2f mapPointSpherical(const Point2f& p, float alpha, Vec4d* J, int pr
|
||||
double x = p.x, y = p.y;
|
||||
double beta = 1 + 2*alpha;
|
||||
double v = x*x + y*y + 1, iv = 1/v;
|
||||
double u = sqrt(beta*v + alpha*alpha);
|
||||
double u = std::sqrt(beta*v + alpha*alpha);
|
||||
|
||||
double k = (u - alpha)*iv;
|
||||
double kv = (v*beta/u - (u - alpha)*2)*iv*iv;
|
||||
@@ -436,8 +436,8 @@ static Point2f mapPointSpherical(const Point2f& p, float alpha, Vec4d* J, int pr
|
||||
|
||||
if(J)
|
||||
{
|
||||
double fx1 = iR/sqrt(1 - x1*x1);
|
||||
double fy1 = iR/sqrt(1 - y1*y1);
|
||||
double fx1 = iR/std::sqrt(1 - x1*x1);
|
||||
double fy1 = iR/std::sqrt(1 - y1*y1);
|
||||
*J = Vec4d(fx1*(kx*x + k), fx1*ky*x, fy1*kx*y, fy1*(ky*y + k));
|
||||
}
|
||||
return Point2f((float)asin(x1), (float)asin(y1));
|
||||
|
Reference in New Issue
Block a user