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:
Andrey Kamaev
2013-02-24 20:14:01 +04:00
parent f783f34e0b
commit 2a6fb2867e
310 changed files with 5744 additions and 5964 deletions

View File

@@ -132,7 +132,7 @@ public:
};
void groupRectangles(vector<Rect>& rectList, int groupThreshold, double eps, vector<int>* weights, vector<double>* levelWeights)
void groupRectangles(std::vector<Rect>& rectList, int groupThreshold, double eps, std::vector<int>* weights, std::vector<double>* levelWeights)
{
if( groupThreshold <= 0 || rectList.empty() )
{
@@ -146,13 +146,13 @@ void groupRectangles(vector<Rect>& rectList, int groupThreshold, double eps, vec
return;
}
vector<int> labels;
std::vector<int> labels;
int nclasses = partition(rectList, labels, SimilarRects(eps));
vector<Rect> rrects(nclasses);
vector<int> rweights(nclasses, 0);
vector<int> rejectLevels(nclasses, 0);
vector<double> rejectWeights(nclasses, DBL_MIN);
std::vector<Rect> rrects(nclasses);
std::vector<int> rweights(nclasses, 0);
std::vector<int> rejectLevels(nclasses, 0);
std::vector<double> rejectWeights(nclasses, DBL_MIN);
int i, j, nlabels = (int)labels.size();
for( i = 0; i < nlabels; i++ )
{
@@ -236,8 +236,8 @@ void groupRectangles(vector<Rect>& rectList, int groupThreshold, double eps, vec
class MeanshiftGrouping
{
public:
MeanshiftGrouping(const Point3d& densKer, const vector<Point3d>& posV,
const vector<double>& wV, double eps, int maxIter = 20)
MeanshiftGrouping(const Point3d& densKer, const std::vector<Point3d>& posV,
const std::vector<double>& wV, double eps, int maxIter = 20)
{
densityKernel = densKer;
weightsV = wV;
@@ -256,7 +256,7 @@ public:
}
}
void getModes(vector<Point3d>& modesV, vector<double>& resWeightsV, const double eps)
void getModes(std::vector<Point3d>& modesV, std::vector<double>& resWeightsV, const double eps)
{
for (size_t i=0; i <distanceV.size(); i++)
{
@@ -284,14 +284,14 @@ public:
}
protected:
vector<Point3d> positionsV;
vector<double> weightsV;
std::vector<Point3d> positionsV;
std::vector<double> weightsV;
Point3d densityKernel;
int positionsCount;
vector<Point3d> meanshiftV;
vector<Point3d> distanceV;
std::vector<Point3d> meanshiftV;
std::vector<Point3d> distanceV;
int iterMax;
double modeEps;
@@ -305,8 +305,8 @@ protected:
Point3d bPt = inPt;
Point3d sPt = densityKernel;
sPt.x *= exp(aPt.z);
sPt.y *= exp(aPt.z);
sPt.x *= std::exp(aPt.z);
sPt.y *= std::exp(aPt.z);
aPt.x /= sPt.x;
aPt.y /= sPt.y;
@@ -338,8 +338,8 @@ protected:
Point3d aPt = positionsV[i];
Point3d sPt = densityKernel;
sPt.x *= exp(aPt.z);
sPt.y *= exp(aPt.z);
sPt.x *= std::exp(aPt.z);
sPt.y *= std::exp(aPt.z);
aPt -= inPt;
@@ -370,8 +370,8 @@ protected:
double getDistance(Point3d p1, Point3d p2) const
{
Point3d ns = densityKernel;
ns.x *= exp(p2.z);
ns.y *= exp(p2.z);
ns.x *= std::exp(p2.z);
ns.y *= std::exp(p2.z);
p2 -= p1;
p2.x /= ns.x;
p2.y /= ns.y;
@@ -380,12 +380,12 @@ protected:
}
};
//new grouping function with using meanshift
static void groupRectangles_meanshift(vector<Rect>& rectList, double detectThreshold, vector<double>* foundWeights,
vector<double>& scales, Size winDetSize)
static void groupRectangles_meanshift(std::vector<Rect>& rectList, double detectThreshold, std::vector<double>* foundWeights,
std::vector<double>& scales, Size winDetSize)
{
int detectionCount = (int)rectList.size();
vector<Point3d> hits(detectionCount), resultHits;
vector<double> hitWeights(detectionCount), resultWeights;
std::vector<Point3d> hits(detectionCount), resultHits;
std::vector<double> hitWeights(detectionCount), resultWeights;
Point2d hitCenter;
for (int i=0; i < detectionCount; i++)
@@ -409,7 +409,7 @@ static void groupRectangles_meanshift(vector<Rect>& rectList, double detectThres
for (unsigned i=0; i < resultHits.size(); ++i)
{
double scale = exp(resultHits[i].z);
double scale = std::exp(resultHits[i].z);
hitCenter.x = resultHits[i].x;
hitCenter.y = resultHits[i].y;
Size s( int(winDetSize.width * scale), int(winDetSize.height * scale) );
@@ -424,23 +424,23 @@ static void groupRectangles_meanshift(vector<Rect>& rectList, double detectThres
}
}
void groupRectangles(vector<Rect>& rectList, int groupThreshold, double eps)
void groupRectangles(std::vector<Rect>& rectList, int groupThreshold, double eps)
{
groupRectangles(rectList, groupThreshold, eps, 0, 0);
}
void groupRectangles(vector<Rect>& rectList, vector<int>& weights, int groupThreshold, double eps)
void groupRectangles(std::vector<Rect>& rectList, std::vector<int>& weights, int groupThreshold, double eps)
{
groupRectangles(rectList, groupThreshold, eps, &weights, 0);
}
//used for cascade detection algorithm for ROC-curve calculating
void groupRectangles(vector<Rect>& rectList, vector<int>& rejectLevels, vector<double>& levelWeights, int groupThreshold, double eps)
void groupRectangles(std::vector<Rect>& rectList, std::vector<int>& rejectLevels, std::vector<double>& levelWeights, int groupThreshold, double eps)
{
groupRectangles(rectList, groupThreshold, eps, &rejectLevels, &levelWeights);
}
//can be used for HOG detection algorithm only
void groupRectangles_meanshift(vector<Rect>& rectList, vector<double>& foundWeights,
vector<double>& foundScales, double detectThreshold, Size winDetSize)
void groupRectangles_meanshift(std::vector<Rect>& rectList, std::vector<double>& foundWeights,
std::vector<double>& foundScales, double detectThreshold, Size winDetSize)
{
groupRectangles_meanshift(rectList, detectThreshold, &foundWeights, foundScales, winDetSize);
}
@@ -483,7 +483,7 @@ bool HaarEvaluator::Feature :: read( const FileNode& node )
HaarEvaluator::HaarEvaluator()
{
features = new vector<Feature>();
features = new std::vector<Feature>();
}
HaarEvaluator::~HaarEvaluator()
{
@@ -578,7 +578,7 @@ bool HaarEvaluator::setWindow( Point pt )
double nf = (double)normrect.area() * valsqsum - (double)valsum * valsum;
if( nf > 0. )
nf = sqrt(nf);
nf = std::sqrt(nf);
else
nf = 1.;
varianceNormFactor = 1./nf;
@@ -598,7 +598,7 @@ bool LBPEvaluator::Feature :: read(const FileNode& node )
LBPEvaluator::LBPEvaluator()
{
features = new vector<Feature>();
features = new std::vector<Feature>();
}
LBPEvaluator::~LBPEvaluator()
{
@@ -678,7 +678,7 @@ bool HOGEvaluator::Feature :: read( const FileNode& node )
HOGEvaluator::HOGEvaluator()
{
features = new vector<Feature>();
features = new std::vector<Feature>();
}
HOGEvaluator::~HOGEvaluator()
@@ -745,7 +745,7 @@ bool HOGEvaluator::setWindow(Point pt)
return true;
}
void HOGEvaluator::integralHistogram(const Mat &img, vector<Mat> &histogram, Mat &norm, int nbins) const
void HOGEvaluator::integralHistogram(const Mat &img, std::vector<Mat> &histogram, Mat &norm, int nbins) const
{
CV_Assert( img.type() == CV_8U || img.type() == CV_8UC3 );
int x, y, binIdx;
@@ -854,7 +854,7 @@ CascadeClassifier::CascadeClassifier()
{
}
CascadeClassifier::CascadeClassifier(const string& filename)
CascadeClassifier::CascadeClassifier(const std::string& filename)
{
load(filename);
}
@@ -868,7 +868,7 @@ bool CascadeClassifier::empty() const
return oldCascade.empty() && data.stages.empty();
}
bool CascadeClassifier::load(const string& filename)
bool CascadeClassifier::load(const std::string& filename)
{
oldCascade.release();
data = Data();
@@ -948,7 +948,7 @@ class CascadeClassifierInvoker : public ParallelLoopBody
{
public:
CascadeClassifierInvoker( CascadeClassifier& _cc, Size _sz1, int _stripSize, int _yStep, double _factor,
vector<Rect>& _vec, vector<int>& _levels, vector<double>& _weights, bool outputLevels, const Mat& _mask, Mutex* _mtx)
std::vector<Rect>& _vec, std::vector<int>& _levels, std::vector<double>& _weights, bool outputLevels, const Mat& _mask, Mutex* _mtx)
{
classifier = &_cc;
processingRectSize = _sz1;
@@ -969,7 +969,7 @@ public:
Size winSize(cvRound(classifier->data.origWinSize.width * scalingFactor), cvRound(classifier->data.origWinSize.height * scalingFactor));
int y1 = range.start * stripSize;
int y2 = min(range.end * stripSize, processingRectSize.height);
int y2 = std::min(range.end * stripSize, processingRectSize.height);
for( int y = y1; y < y2; y += yStep )
{
for( int x = 0; x < processingRectSize.width; x += yStep )
@@ -1012,12 +1012,12 @@ public:
}
CascadeClassifier* classifier;
vector<Rect>* rectangles;
std::vector<Rect>* rectangles;
Size processingRectSize;
int stripSize, yStep;
double scalingFactor;
vector<int> *rejectLevels;
vector<double> *levelWeights;
std::vector<int> *rejectLevels;
std::vector<double> *levelWeights;
Mat mask;
Mutex* mtx;
};
@@ -1026,8 +1026,8 @@ struct getRect { Rect operator ()(const CvAvgComp& e) const { return e.rect; } }
bool CascadeClassifier::detectSingleScale( const Mat& image, int stripCount, Size processingRectSize,
int stripSize, int yStep, double factor, vector<Rect>& candidates,
vector<int>& levels, vector<double>& weights, bool outputRejectLevels )
int stripSize, int yStep, double factor, std::vector<Rect>& candidates,
std::vector<int>& levels, std::vector<double>& weights, bool outputRejectLevels )
{
if( !featureEvaluator->setImage( image, data.origWinSize ) )
return false;
@@ -1041,9 +1041,9 @@ bool CascadeClassifier::detectSingleScale( const Mat& image, int stripCount, Siz
currentMask=maskGenerator->generateMask(image);
}
vector<Rect> candidatesVector;
vector<int> rejectLevels;
vector<double> levelWeights;
std::vector<Rect> candidatesVector;
std::vector<int> rejectLevels;
std::vector<double> levelWeights;
Mutex mtx;
if( outputRejectLevels )
{
@@ -1087,9 +1087,9 @@ bool CascadeClassifier::setImage(const Mat& image)
return featureEvaluator->setImage(image, data.origWinSize);
}
void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects,
vector<int>& rejectLevels,
vector<double>& levelWeights,
void CascadeClassifier::detectMultiScale( const Mat& image, std::vector<Rect>& objects,
std::vector<int>& rejectLevels,
std::vector<double>& levelWeights,
double scaleFactor, int minNeighbors,
int flags, Size minObjectSize, Size maxObjectSize,
bool outputRejectLevels )
@@ -1107,7 +1107,7 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
CvMat _image = image;
CvSeq* _objects = cvHaarDetectObjectsForROC( &_image, oldCascade, storage, rejectLevels, levelWeights, scaleFactor,
minNeighbors, flags, minObjectSize, maxObjectSize, outputRejectLevels );
vector<CvAvgComp> vecAvgComp;
std::vector<CvAvgComp> vecAvgComp;
Seq<CvAvgComp>(_objects).copyTo(vecAvgComp);
objects.resize(vecAvgComp.size());
std::transform(vecAvgComp.begin(), vecAvgComp.end(), objects.begin(), getRect());
@@ -1133,7 +1133,7 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
}
Mat imageBuffer(image.rows + 1, image.cols + 1, CV_8U);
vector<Rect> candidates;
std::vector<Rect> candidates;
for( double factor = 1; ; factor *= scaleFactor )
{
@@ -1194,12 +1194,12 @@ void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& object
}
}
void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects,
void CascadeClassifier::detectMultiScale( const Mat& image, std::vector<Rect>& objects,
double scaleFactor, int minNeighbors,
int flags, Size minObjectSize, Size maxObjectSize)
{
vector<int> fakeLevels;
vector<double> fakeWeights;
std::vector<int> fakeLevels;
std::vector<double> fakeWeights;
detectMultiScale( image, objects, fakeLevels, fakeWeights, scaleFactor,
minNeighbors, flags, minObjectSize, maxObjectSize, false );
}
@@ -1209,13 +1209,13 @@ bool CascadeClassifier::Data::read(const FileNode &root)
static const float THRESHOLD_EPS = 1e-5f;
// load stage params
string stageTypeStr = (string)root[CC_STAGE_TYPE];
std::string stageTypeStr = (std::string)root[CC_STAGE_TYPE];
if( stageTypeStr == CC_BOOST )
stageType = BOOST;
else
return false;
string featureTypeStr = (string)root[CC_FEATURE_TYPE];
std::string featureTypeStr = (std::string)root[CC_FEATURE_TYPE];
if( featureTypeStr == CC_HAAR )
featureType = FeatureEvaluator::HAAR;
else if( featureTypeStr == CC_LBP )