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

@@ -44,7 +44,6 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
@@ -549,13 +548,13 @@ void cv::gpu::normalize(const GpuMat& src, GpuMat& dst, double a, double b, int
double smin = 0, smax = 0;
double dmin = std::min(a, b), dmax = std::max(a, b);
minMax(src, &smin, &smax, mask, norm_buf);
scale = (dmax - dmin) * (smax - smin > numeric_limits<double>::epsilon() ? 1.0 / (smax - smin) : 0.0);
scale = (dmax - dmin) * (smax - smin > std::numeric_limits<double>::epsilon() ? 1.0 / (smax - smin) : 0.0);
shift = dmin - smin * scale;
}
else if (norm_type == NORM_L2 || norm_type == NORM_L1 || norm_type == NORM_INF)
{
scale = norm(src, norm_type, mask, norm_buf);
scale = scale > numeric_limits<double>::epsilon() ? a / scale : 0.0;
scale = scale > std::numeric_limits<double>::epsilon() ? a / scale : 0.0;
shift = 0;
}
else

View File

@@ -44,7 +44,6 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
@@ -107,7 +106,7 @@ namespace
GpuMat& table_color, GpuMat& table_space,
const GpuMat& disp, const GpuMat& img, GpuMat& dst, Stream& stream)
{
short edge_disc = max<short>(short(1), short(ndisp * edge_threshold + 0.5));
short edge_disc = std::max<short>(short(1), short(ndisp * edge_threshold + 0.5));
short max_disc = short(ndisp * max_disc_threshold + 0.5);
disp_load_constants(table_color.ptr<float>(), table_space, ndisp, radius, edge_disc, max_disc);

View File

@@ -42,7 +42,6 @@
#include "precomp.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;

View File

@@ -44,41 +44,40 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
cv::gpu::BFMatcher_GPU::BFMatcher_GPU(int) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::add(const vector<GpuMat>&) { throw_nogpu(); }
const vector<GpuMat>& cv::gpu::BFMatcher_GPU::getTrainDescriptors() const { throw_nogpu(); return trainDescCollection; }
void cv::gpu::BFMatcher_GPU::add(const std::vector<GpuMat>&) { throw_nogpu(); }
const std::vector<GpuMat>& cv::gpu::BFMatcher_GPU::getTrainDescriptors() const { throw_nogpu(); return trainDescCollection; }
void cv::gpu::BFMatcher_GPU::clear() { throw_nogpu(); }
bool cv::gpu::BFMatcher_GPU::empty() const { throw_nogpu(); return true; }
bool cv::gpu::BFMatcher_GPU::isMaskSupported() const { throw_nogpu(); return true; }
void cv::gpu::BFMatcher_GPU::matchSingle(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, const GpuMat&, Stream&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat&, const GpuMat&, vector<DMatch>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::matchConvert(const Mat&, const Mat&, vector<DMatch>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::match(const GpuMat&, const GpuMat&, vector<DMatch>&, const GpuMat&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::makeGpuCollection(GpuMat&, GpuMat&, const vector<GpuMat>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat&, const GpuMat&, std::vector<DMatch>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::matchConvert(const Mat&, const Mat&, std::vector<DMatch>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::match(const GpuMat&, const GpuMat&, std::vector<DMatch>&, const GpuMat&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::makeGpuCollection(GpuMat&, GpuMat&, const std::vector<GpuMat>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::matchCollection(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, const GpuMat&, Stream&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat&, const GpuMat&, const GpuMat&, vector<DMatch>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::matchConvert(const Mat&, const Mat&, const Mat&, vector<DMatch>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::match(const GpuMat&, vector<DMatch>&, const vector<GpuMat>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat&, const GpuMat&, const GpuMat&, std::vector<DMatch>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::matchConvert(const Mat&, const Mat&, const Mat&, std::vector<DMatch>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::match(const GpuMat&, std::vector<DMatch>&, const std::vector<GpuMat>&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatchSingle(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, int, const GpuMat&, Stream&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatchDownload(const GpuMat&, const GpuMat&, vector< vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatchConvert(const Mat&, const Mat&, vector< vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat&, const GpuMat&, vector< vector<DMatch> >&, int, const GpuMat&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatchDownload(const GpuMat&, const GpuMat&, std::vector< std::vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatchConvert(const Mat&, const Mat&, std::vector< std::vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat&, const GpuMat&, std::vector< std::vector<DMatch> >&, int, const GpuMat&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatch2Collection(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, const GpuMat&, Stream&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatch2Download(const GpuMat&, const GpuMat&, const GpuMat&, vector< vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatch2Convert(const Mat&, const Mat&, const Mat&, vector< vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat&, vector< vector<DMatch> >&, int, const vector<GpuMat>&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatch2Download(const GpuMat&, const GpuMat&, const GpuMat&, std::vector< std::vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatch2Convert(const Mat&, const Mat&, const Mat&, std::vector< std::vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat&, std::vector< std::vector<DMatch> >&, int, const std::vector<GpuMat>&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchSingle(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, GpuMat&, float, const GpuMat&, Stream&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat&, const GpuMat&, const GpuMat&, vector< vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat&, const Mat&, const Mat&, vector< vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat&, const GpuMat&, vector< vector<DMatch> >&, float, const GpuMat&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchCollection(const GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, float, const vector<GpuMat>&, Stream&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat&, const GpuMat&, const GpuMat&, const GpuMat&, vector< vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat&, const Mat&, const Mat&, const Mat&, vector< vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat&, vector< vector<DMatch> >&, float, const vector<GpuMat>&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat&, const GpuMat&, const GpuMat&, std::vector< std::vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat&, const Mat&, const Mat&, std::vector< std::vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat&, const GpuMat&, std::vector< std::vector<DMatch> >&, float, const GpuMat&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchCollection(const GpuMat&, GpuMat&, GpuMat&, GpuMat&, GpuMat&, float, const std::vector<GpuMat>&, Stream&) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat&, const GpuMat&, const GpuMat&, const GpuMat&, std::vector< std::vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat&, const Mat&, const Mat&, const Mat&, std::vector< std::vector<DMatch> >&, bool) { throw_nogpu(); }
void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat&, std::vector< std::vector<DMatch> >&, float, const std::vector<GpuMat>&, bool) { throw_nogpu(); }
#else /* !defined (HAVE_CUDA) */
@@ -163,12 +162,12 @@ cv::gpu::BFMatcher_GPU::BFMatcher_GPU(int norm_) : norm(norm_)
{
}
void cv::gpu::BFMatcher_GPU::add(const vector<GpuMat>& descCollection)
void cv::gpu::BFMatcher_GPU::add(const std::vector<GpuMat>& descCollection)
{
trainDescCollection.insert(trainDescCollection.end(), descCollection.begin(), descCollection.end());
}
const vector<GpuMat>& cv::gpu::BFMatcher_GPU::getTrainDescriptors() const
const std::vector<GpuMat>& cv::gpu::BFMatcher_GPU::getTrainDescriptors() const
{
return trainDescCollection;
}
@@ -241,7 +240,7 @@ void cv::gpu::BFMatcher_GPU::matchSingle(const GpuMat& query, const GpuMat& trai
func(query, train, mask, trainIdx, distance, StreamAccessor::getStream(stream));
}
void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat& trainIdx, const GpuMat& distance, vector<DMatch>& matches)
void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat& trainIdx, const GpuMat& distance, std::vector<DMatch>& matches)
{
if (trainIdx.empty() || distance.empty())
return;
@@ -252,7 +251,7 @@ void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat& trainIdx, const GpuMat&
matchConvert(trainIdxCPU, distanceCPU, matches);
}
void cv::gpu::BFMatcher_GPU::matchConvert(const Mat& trainIdx, const Mat& distance, vector<DMatch>& matches)
void cv::gpu::BFMatcher_GPU::matchConvert(const Mat& trainIdx, const Mat& distance, std::vector<DMatch>& matches)
{
if (trainIdx.empty() || distance.empty())
return;
@@ -283,7 +282,7 @@ void cv::gpu::BFMatcher_GPU::matchConvert(const Mat& trainIdx, const Mat& distan
}
void cv::gpu::BFMatcher_GPU::match(const GpuMat& query, const GpuMat& train,
vector<DMatch>& matches, const GpuMat& mask)
std::vector<DMatch>& matches, const GpuMat& mask)
{
GpuMat trainIdx, distance;
matchSingle(query, train, trainIdx, distance, mask);
@@ -291,7 +290,7 @@ void cv::gpu::BFMatcher_GPU::match(const GpuMat& query, const GpuMat& train,
}
void cv::gpu::BFMatcher_GPU::makeGpuCollection(GpuMat& trainCollection, GpuMat& maskCollection,
const vector<GpuMat>& masks)
const std::vector<GpuMat>& masks)
{
if (empty())
return;
@@ -383,7 +382,7 @@ void cv::gpu::BFMatcher_GPU::matchCollection(const GpuMat& query, const GpuMat&
func(query, trainCollection, masks, trainIdx, imgIdx, distance, StreamAccessor::getStream(stream));
}
void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat& trainIdx, const GpuMat& imgIdx, const GpuMat& distance, vector<DMatch>& matches)
void cv::gpu::BFMatcher_GPU::matchDownload(const GpuMat& trainIdx, const GpuMat& imgIdx, const GpuMat& distance, std::vector<DMatch>& matches)
{
if (trainIdx.empty() || imgIdx.empty() || distance.empty())
return;
@@ -429,7 +428,7 @@ void cv::gpu::BFMatcher_GPU::matchConvert(const Mat& trainIdx, const Mat& imgIdx
}
}
void cv::gpu::BFMatcher_GPU::match(const GpuMat& query, vector<DMatch>& matches, const vector<GpuMat>& masks)
void cv::gpu::BFMatcher_GPU::match(const GpuMat& query, std::vector<DMatch>& matches, const std::vector<GpuMat>& masks)
{
GpuMat trainCollection;
GpuMat maskCollection;
@@ -510,7 +509,7 @@ void cv::gpu::BFMatcher_GPU::knnMatchSingle(const GpuMat& query, const GpuMat& t
}
void cv::gpu::BFMatcher_GPU::knnMatchDownload(const GpuMat& trainIdx, const GpuMat& distance,
vector< vector<DMatch> >& matches, bool compactResult)
std::vector< std::vector<DMatch> >& matches, bool compactResult)
{
if (trainIdx.empty() || distance.empty())
return;
@@ -522,7 +521,7 @@ void cv::gpu::BFMatcher_GPU::knnMatchDownload(const GpuMat& trainIdx, const GpuM
}
void cv::gpu::BFMatcher_GPU::knnMatchConvert(const Mat& trainIdx, const Mat& distance,
vector< vector<DMatch> >& matches, bool compactResult)
std::vector< std::vector<DMatch> >& matches, bool compactResult)
{
if (trainIdx.empty() || distance.empty())
return;
@@ -543,8 +542,8 @@ void cv::gpu::BFMatcher_GPU::knnMatchConvert(const Mat& trainIdx, const Mat& dis
for (int queryIdx = 0; queryIdx < nQuery; ++queryIdx)
{
matches.push_back(vector<DMatch>());
vector<DMatch>& curMatches = matches.back();
matches.push_back(std::vector<DMatch>());
std::vector<DMatch>& curMatches = matches.back();
curMatches.reserve(k);
for (int i = 0; i < k; ++i, ++trainIdx_ptr, ++distance_ptr)
@@ -567,7 +566,7 @@ void cv::gpu::BFMatcher_GPU::knnMatchConvert(const Mat& trainIdx, const Mat& dis
}
void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat& query, const GpuMat& train,
vector< vector<DMatch> >& matches, int k, const GpuMat& mask, bool compactResult)
std::vector< std::vector<DMatch> >& matches, int k, const GpuMat& mask, bool compactResult)
{
GpuMat trainIdx, distance, allDist;
knnMatchSingle(query, train, trainIdx, distance, allDist, k, mask);
@@ -629,7 +628,7 @@ void cv::gpu::BFMatcher_GPU::knnMatch2Collection(const GpuMat& query, const GpuM
}
void cv::gpu::BFMatcher_GPU::knnMatch2Download(const GpuMat& trainIdx, const GpuMat& imgIdx, const GpuMat& distance,
vector< vector<DMatch> >& matches, bool compactResult)
std::vector< std::vector<DMatch> >& matches, bool compactResult)
{
if (trainIdx.empty() || imgIdx.empty() || distance.empty())
return;
@@ -642,7 +641,7 @@ void cv::gpu::BFMatcher_GPU::knnMatch2Download(const GpuMat& trainIdx, const Gpu
}
void cv::gpu::BFMatcher_GPU::knnMatch2Convert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance,
vector< vector<DMatch> >& matches, bool compactResult)
std::vector< std::vector<DMatch> >& matches, bool compactResult)
{
if (trainIdx.empty() || imgIdx.empty() || distance.empty())
return;
@@ -662,8 +661,8 @@ void cv::gpu::BFMatcher_GPU::knnMatch2Convert(const Mat& trainIdx, const Mat& im
for (int queryIdx = 0; queryIdx < nQuery; ++queryIdx)
{
matches.push_back(vector<DMatch>());
vector<DMatch>& curMatches = matches.back();
matches.push_back(std::vector<DMatch>());
std::vector<DMatch>& curMatches = matches.back();
curMatches.reserve(2);
for (int i = 0; i < 2; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)
@@ -697,8 +696,8 @@ namespace
};
}
void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat& query, vector< vector<DMatch> >& matches, int k,
const vector<GpuMat>& masks, bool compactResult)
void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat& query, std::vector< std::vector<DMatch> >& matches, int k,
const std::vector<GpuMat>& masks, bool compactResult)
{
if (k == 2)
{
@@ -717,12 +716,12 @@ void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat& query, vector< vector<DMatch
if (query.empty() || empty())
return;
vector< vector<DMatch> > curMatches;
vector<DMatch> temp;
std::vector< std::vector<DMatch> > curMatches;
std::vector<DMatch> temp;
temp.reserve(2 * k);
matches.resize(query.rows);
for_each(matches.begin(), matches.end(), bind2nd(mem_fun_ref(&vector<DMatch>::reserve), k));
for_each(matches.begin(), matches.end(), bind2nd(mem_fun_ref(&std::vector<DMatch>::reserve), k));
for (size_t imgIdx = 0, size = trainDescCollection.size(); imgIdx < size; ++imgIdx)
{
@@ -730,8 +729,8 @@ void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat& query, vector< vector<DMatch
for (int queryIdx = 0; queryIdx < query.rows; ++queryIdx)
{
vector<DMatch>& localMatch = curMatches[queryIdx];
vector<DMatch>& globalMatch = matches[queryIdx];
std::vector<DMatch>& localMatch = curMatches[queryIdx];
std::vector<DMatch>& globalMatch = matches[queryIdx];
for_each(localMatch.begin(), localMatch.end(), ImgIdxSetter(static_cast<int>(imgIdx)));
@@ -746,7 +745,7 @@ void cv::gpu::BFMatcher_GPU::knnMatch(const GpuMat& query, vector< vector<DMatch
if (compactResult)
{
vector< vector<DMatch> >::iterator new_end = remove_if(matches.begin(), matches.end(), mem_fun_ref(&vector<DMatch>::empty));
std::vector< std::vector<DMatch> >::iterator new_end = remove_if(matches.begin(), matches.end(), mem_fun_ref(&std::vector<DMatch>::empty));
matches.erase(new_end, matches.end());
}
}
@@ -816,7 +815,7 @@ void cv::gpu::BFMatcher_GPU::radiusMatchSingle(const GpuMat& query, const GpuMat
}
void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat& trainIdx, const GpuMat& distance, const GpuMat& nMatches,
vector< vector<DMatch> >& matches, bool compactResult)
std::vector< std::vector<DMatch> >& matches, bool compactResult)
{
if (trainIdx.empty() || distance.empty() || nMatches.empty())
return;
@@ -829,7 +828,7 @@ void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat& trainIdx, const G
}
void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat& distance, const Mat& nMatches,
vector< vector<DMatch> >& matches, bool compactResult)
std::vector< std::vector<DMatch> >& matches, bool compactResult)
{
if (trainIdx.empty() || distance.empty() || nMatches.empty())
return;
@@ -855,12 +854,12 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
if (nMatched == 0)
{
if (!compactResult)
matches.push_back(vector<DMatch>());
matches.push_back(std::vector<DMatch>());
continue;
}
matches.push_back(vector<DMatch>(nMatched));
vector<DMatch>& curMatches = matches.back();
matches.push_back(std::vector<DMatch>(nMatched));
std::vector<DMatch>& curMatches = matches.back();
for (int i = 0; i < nMatched; ++i, ++trainIdx_ptr, ++distance_ptr)
{
@@ -878,7 +877,7 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
}
void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat& query, const GpuMat& train,
vector< vector<DMatch> >& matches, float maxDistance, const GpuMat& mask, bool compactResult)
std::vector< std::vector<DMatch> >& matches, float maxDistance, const GpuMat& mask, bool compactResult)
{
GpuMat trainIdx, distance, nMatches;
radiusMatchSingle(query, train, trainIdx, distance, nMatches, maxDistance, mask);
@@ -886,7 +885,7 @@ void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat& query, const GpuMat& trai
}
void cv::gpu::BFMatcher_GPU::radiusMatchCollection(const GpuMat& query, GpuMat& trainIdx, GpuMat& imgIdx, GpuMat& distance, GpuMat& nMatches,
float maxDistance, const vector<GpuMat>& masks, Stream& stream)
float maxDistance, const std::vector<GpuMat>& masks, Stream& stream)
{
if (query.empty() || empty())
return;
@@ -940,15 +939,15 @@ void cv::gpu::BFMatcher_GPU::radiusMatchCollection(const GpuMat& query, GpuMat&
caller_t func = callers[query.depth()];
CV_Assert(func != 0);
vector<PtrStepSzb> trains_(trainDescCollection.begin(), trainDescCollection.end());
vector<PtrStepSzb> masks_(masks.begin(), masks.end());
std::vector<PtrStepSzb> trains_(trainDescCollection.begin(), trainDescCollection.end());
std::vector<PtrStepSzb> masks_(masks.begin(), masks.end());
func(query, &trains_[0], static_cast<int>(trains_.size()), maxDistance, masks_.size() == 0 ? 0 : &masks_[0],
trainIdx, imgIdx, distance, nMatches, StreamAccessor::getStream(stream));
}
void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat& trainIdx, const GpuMat& imgIdx, const GpuMat& distance, const GpuMat& nMatches,
vector< vector<DMatch> >& matches, bool compactResult)
std::vector< std::vector<DMatch> >& matches, bool compactResult)
{
if (trainIdx.empty() || imgIdx.empty() || distance.empty() || nMatches.empty())
return;
@@ -962,7 +961,7 @@ void cv::gpu::BFMatcher_GPU::radiusMatchDownload(const GpuMat& trainIdx, const G
}
void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat& imgIdx, const Mat& distance, const Mat& nMatches,
vector< vector<DMatch> >& matches, bool compactResult)
std::vector< std::vector<DMatch> >& matches, bool compactResult)
{
if (trainIdx.empty() || imgIdx.empty() || distance.empty() || nMatches.empty())
return;
@@ -990,12 +989,12 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
if (nMatched == 0)
{
if (!compactResult)
matches.push_back(vector<DMatch>());
matches.push_back(std::vector<DMatch>());
continue;
}
matches.push_back(vector<DMatch>());
vector<DMatch>& curMatches = matches.back();
matches.push_back(std::vector<DMatch>());
std::vector<DMatch>& curMatches = matches.back();
curMatches.reserve(nMatched);
for (int i = 0; i < nMatched; ++i, ++trainIdx_ptr, ++imgIdx_ptr, ++distance_ptr)
@@ -1013,8 +1012,8 @@ void cv::gpu::BFMatcher_GPU::radiusMatchConvert(const Mat& trainIdx, const Mat&
}
}
void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat& query, vector< vector<DMatch> >& matches,
float maxDistance, const vector<GpuMat>& masks, bool compactResult)
void cv::gpu::BFMatcher_GPU::radiusMatch(const GpuMat& query, std::vector< std::vector<DMatch> >& matches,
float maxDistance, const std::vector<GpuMat>& masks, bool compactResult)
{
GpuMat trainIdx, imgIdx, distance, nMatches;
radiusMatchCollection(query, trainIdx, imgIdx, distance, nMatches, maxDistance, masks);

View File

@@ -44,7 +44,6 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined HAVE_CUDA || defined(CUDA_DISABLER)
@@ -52,7 +51,7 @@ void cv::gpu::transformPoints(const GpuMat&, const Mat&, const Mat&, GpuMat&, St
void cv::gpu::projectPoints(const GpuMat&, const Mat&, const Mat&, const Mat&, const Mat&, GpuMat&, Stream&) { throw_nogpu(); }
void cv::gpu::solvePnPRansac(const Mat&, const Mat&, const Mat&, const Mat&, Mat&, Mat&, bool, int, float, int, vector<int>*) { throw_nogpu(); }
void cv::gpu::solvePnPRansac(const Mat&, const Mat&, const Mat&, const Mat&, Mat&, Mat&, bool, int, float, int, std::vector<int>*) { throw_nogpu(); }
#else
@@ -130,7 +129,7 @@ void cv::gpu::projectPoints(const GpuMat& src, const Mat& rvec, const Mat& tvec,
namespace
{
// Selects subset_size random different points from [0, num_points - 1] range
void selectRandom(int subset_size, int num_points, vector<int>& subset)
void selectRandom(int subset_size, int num_points, std::vector<int>& subset)
{
subset.resize(subset_size);
for (int i = 0; i < subset_size; ++i)
@@ -164,7 +163,7 @@ namespace
void operator()(const BlockedRange& range) const
{
// Input data for generation of the current hypothesis
vector<int> subset_indices(subset_size);
std::vector<int> subset_indices(subset_size);
Mat_<Point3f> object_subset(1, subset_size);
Mat_<Point2f> image_subset(1, subset_size);
@@ -212,7 +211,7 @@ namespace
void cv::gpu::solvePnPRansac(const Mat& object, const Mat& image, const Mat& camera_mat,
const Mat& dist_coef, Mat& rvec, Mat& tvec, bool use_extrinsic_guess,
int num_iters, float max_dist, int min_inlier_count,
vector<int>* inliers)
std::vector<int>* inliers)
{
(void)min_inlier_count;
CV_Assert(object.rows == 1 && object.cols > 0 && object.type() == CV_32FC3);

View File

@@ -46,15 +46,14 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU() { throw_nogpu(); }
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const string&) { throw_nogpu(); }
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const std::string&) { throw_nogpu(); }
cv::gpu::CascadeClassifier_GPU::~CascadeClassifier_GPU() { throw_nogpu(); }
bool cv::gpu::CascadeClassifier_GPU::empty() const { throw_nogpu(); return true; }
bool cv::gpu::CascadeClassifier_GPU::load(const string&) { throw_nogpu(); return true; }
bool cv::gpu::CascadeClassifier_GPU::load(const std::string&) { throw_nogpu(); return true; }
Size cv::gpu::CascadeClassifier_GPU::getClassifierSize() const { throw_nogpu(); return Size();}
void cv::gpu::CascadeClassifier_GPU::release() { throw_nogpu(); }
int cv::gpu::CascadeClassifier_GPU::detectMultiScale( const GpuMat&, GpuMat&, double, int, Size) {throw_nogpu(); return -1;}
@@ -72,7 +71,7 @@ public:
bool findLargestObject, bool visualizeInPlace, cv::Size ncvMinSize, cv::Size maxObjectSize) = 0;
virtual cv::Size getClassifierCvSize() const = 0;
virtual bool read(const string& classifierAsXml) = 0;
virtual bool read(const std::string& classifierAsXml) = 0;
};
struct cv::gpu::CascadeClassifier_GPU::HaarCascade : cv::gpu::CascadeClassifier_GPU::CascadeClassifierImpl
@@ -83,7 +82,7 @@ public:
ncvSetDebugOutputHandler(NCVDebugOutputHandler);
}
bool read(const string& filename)
bool read(const std::string& filename)
{
ncvSafeCall( load(filename) );
return true;
@@ -172,7 +171,7 @@ public:
private:
static void NCVDebugOutputHandler(const std::string &msg) { CV_Error(CV_GpuApiCallError, msg.c_str()); }
NCVStatus load(const string& classifierFile)
NCVStatus load(const std::string& classifierFile)
{
int devId = cv::gpu::getDevice();
ncvAssertCUDAReturn(cudaGetDeviceProperties(&devProp, devId), NCV_CUDA_ERROR);
@@ -459,7 +458,7 @@ public:
virtual cv::Size getClassifierCvSize() const { return NxM; }
bool read(const string& classifierAsXml)
bool read(const std::string& classifierAsXml)
{
FileStorage fs(classifierAsXml, FileStorage::READ);
return fs.isOpened() ? read(fs.getFirstTopLevelNode()) : false;
@@ -513,10 +512,10 @@ private:
const char *GPU_CC_FEATURES = "features";
const char *GPU_CC_RECT = "rect";
std::string stageTypeStr = (string)root[GPU_CC_STAGE_TYPE];
std::string stageTypeStr = (std::string)root[GPU_CC_STAGE_TYPE];
CV_Assert(stageTypeStr == GPU_CC_BOOST);
string featureTypeStr = (string)root[GPU_CC_FEATURE_TYPE];
std::string featureTypeStr = (std::string)root[GPU_CC_FEATURE_TYPE];
CV_Assert(featureTypeStr == GPU_CC_LBP);
NxM.width = (int)root[GPU_CC_WIDTH];
@@ -663,7 +662,7 @@ private:
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU()
: findLargestObject(false), visualizeInPlace(false), impl(0) {}
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const string& filename)
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const std::string& filename)
: findLargestObject(false), visualizeInPlace(false), impl(0) { load(filename); }
cv::gpu::CascadeClassifier_GPU::~CascadeClassifier_GPU() { release(); }
@@ -689,7 +688,7 @@ int cv::gpu::CascadeClassifier_GPU::detectMultiScale(const GpuMat& image, GpuMat
return impl->process(image, objectsBuf, (float)scaleFactor, minNeighbors, findLargestObject, visualizeInPlace, minSize, maxObjectSize);
}
bool cv::gpu::CascadeClassifier_GPU::load(const string& filename)
bool cv::gpu::CascadeClassifier_GPU::load(const std::string& filename)
{
release();
@@ -711,7 +710,7 @@ bool cv::gpu::CascadeClassifier_GPU::load(const string& filename)
}
const char *GPU_CC_LBP = "LBP";
string featureTypeStr = (string)fs.getFirstTopLevelNode()["featureType"];
std::string featureTypeStr = (std::string)fs.getFirstTopLevelNode()["featureType"];
if (featureTypeStr == GPU_CC_LBP)
impl = new LbpCascade();
else
@@ -743,12 +742,12 @@ struct RectConvert
void groupRectangles(std::vector<NcvRect32u> &hypotheses, int groupThreshold, double eps, std::vector<Ncv32u> *weights)
{
vector<Rect> rects(hypotheses.size());
std::vector<Rect> rects(hypotheses.size());
std::transform(hypotheses.begin(), hypotheses.end(), rects.begin(), RectConvert());
if (weights)
{
vector<int> weights_int;
std::vector<int> weights_int;
weights_int.assign(weights->begin(), weights->end());
cv::groupRectangles(rects, weights_int, groupThreshold, eps);
}

View File

@@ -42,7 +42,6 @@
#include "precomp.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;
@@ -256,7 +255,8 @@ void cv::gpu::Stream::enqueueConvert(const GpuMat& src, GpuMat& dst, int dtype,
CV_Error(CV_StsUnsupportedFormat, "The device doesn't support double");
}
bool noScale = fabs(alpha - 1) < numeric_limits<double>::epsilon() && fabs(beta) < numeric_limits<double>::epsilon();
bool noScale = fabs(alpha - 1) < std::numeric_limits<double>::epsilon()
&& fabs(beta) < std::numeric_limits<double>::epsilon();
if (sdepth == ddepth && noScale)
{

View File

@@ -44,7 +44,6 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#ifdef HAVE_CUDA
@@ -55,7 +54,7 @@ namespace
struct ErrorEntry
{
int code;
string str;
std::string str;
};
struct ErrorEntryComparer
@@ -65,13 +64,13 @@ namespace
bool operator()(const ErrorEntry& e) const { return e.code == code; }
};
string getErrorString(int code, const ErrorEntry* errors, size_t n)
std::string getErrorString(int code, const ErrorEntry* errors, size_t n)
{
size_t idx = find_if(errors, errors + n, ErrorEntryComparer(code)) - errors;
size_t idx = std::find_if(errors, errors + n, ErrorEntryComparer(code)) - errors;
const string& msg = (idx != n) ? errors[idx].str : string("Unknown error code");
const std::string& msg = (idx != n) ? errors[idx].str : std::string("Unknown error code");
ostringstream ostr;
std::ostringstream ostr;
ostr << msg << " [Code = " << code << "]";
return ostr.str();
@@ -222,25 +221,25 @@ namespace cv
{
void nppError(int code, const char *file, const int line, const char *func)
{
string msg = getErrorString(code, npp_errors, npp_error_num);
std::string msg = getErrorString(code, npp_errors, npp_error_num);
cv::gpu::error(msg.c_str(), file, line, func);
}
void ncvError(int code, const char *file, const int line, const char *func)
{
string msg = getErrorString(code, ncv_errors, ncv_error_num);
std::string msg = getErrorString(code, ncv_errors, ncv_error_num);
cv::gpu::error(msg.c_str(), file, line, func);
}
void cufftError(int code, const char *file, const int line, const char *func)
{
string msg = getErrorString(code, cufft_errors, cufft_error_num);
std::string msg = getErrorString(code, cufft_errors, cufft_error_num);
cv::gpu::error(msg.c_str(), file, line, func);
}
void cublasError(int code, const char *file, const int line, const char *func)
{
string msg = getErrorString(code, cublas_errors, cublas_error_num);
std::string msg = getErrorString(code, cublas_errors, cublas_error_num);
cv::gpu::error(msg.c_str(), file, line, func);
}
}

View File

@@ -44,7 +44,6 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)

View File

@@ -42,7 +42,6 @@
#include "precomp.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;
@@ -94,11 +93,11 @@ void cv::gpu::GoodFeaturesToTrackDetector_GPU::operator ()(const GpuMat& image,
tmpCorners_.colRange(0, maxCorners > 0 ? std::min(maxCorners, total) : total).copyTo(corners);
else
{
vector<Point2f> tmp(total);
std::vector<Point2f> tmp(total);
Mat tmpMat(1, total, CV_32FC2, (void*)&tmp[0]);
tmpCorners_.colRange(0, total).download(tmpMat);
vector<Point2f> tmp2;
std::vector<Point2f> tmp2;
tmp2.reserve(total);
const int cell_size = cvRound(minDistance);
@@ -131,7 +130,7 @@ void cv::gpu::GoodFeaturesToTrackDetector_GPU::operator ()(const GpuMat& image,
{
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.empty())
{

View File

@@ -42,7 +42,6 @@
#include "precomp.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;

View File

@@ -49,16 +49,16 @@ size_t cv::gpu::HOGDescriptor::getDescriptorSize() const { throw_nogpu(); return
size_t cv::gpu::HOGDescriptor::getBlockHistogramSize() const { throw_nogpu(); return 0; }
double cv::gpu::HOGDescriptor::getWinSigma() const { throw_nogpu(); return 0; }
bool cv::gpu::HOGDescriptor::checkDetectorSize() const { throw_nogpu(); return false; }
void cv::gpu::HOGDescriptor::setSVMDetector(const vector<float>&) { throw_nogpu(); }
void cv::gpu::HOGDescriptor::detect(const GpuMat&, vector<Point>&, double, Size, Size) { throw_nogpu(); }
void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat&, vector<Rect>&, double, Size, Size, double, int) { throw_nogpu(); }
void cv::gpu::HOGDescriptor::setSVMDetector(const std::vector<float>&) { throw_nogpu(); }
void cv::gpu::HOGDescriptor::detect(const GpuMat&, std::vector<Point>&, double, Size, Size) { throw_nogpu(); }
void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat&, std::vector<Rect>&, double, Size, Size, double, int) { throw_nogpu(); }
void cv::gpu::HOGDescriptor::computeBlockHistograms(const GpuMat&) { throw_nogpu(); }
void cv::gpu::HOGDescriptor::getDescriptors(const GpuMat&, Size, GpuMat&, int) { throw_nogpu(); }
std::vector<float> cv::gpu::HOGDescriptor::getDefaultPeopleDetector() { throw_nogpu(); return std::vector<float>(); }
std::vector<float> cv::gpu::HOGDescriptor::getPeopleDetector48x96() { throw_nogpu(); return std::vector<float>(); }
std::vector<float> cv::gpu::HOGDescriptor::getPeopleDetector64x128() { throw_nogpu(); return std::vector<float>(); }
void cv::gpu::HOGDescriptor::computeConfidence(const GpuMat&, vector<Point>&, double, Size, Size, vector<Point>&, vector<double>&) { throw_nogpu(); }
void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat&, vector<Rect>&, double, Size, Size, vector<HOGConfidence>&, int) { throw_nogpu(); }
void cv::gpu::HOGDescriptor::computeConfidence(const GpuMat&, std::vector<Point>&, double, Size, Size, std::vector<Point>&, std::vector<double>&) { throw_nogpu(); }
void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat&, std::vector<Rect>&, double, Size, Size, std::vector<HOGConfidence>&, int) { throw_nogpu(); }
#else
@@ -155,7 +155,7 @@ bool cv::gpu::HOGDescriptor::checkDetectorSize() const
return detector_size == 0 || detector_size == descriptor_size || detector_size == descriptor_size + 1;
}
void cv::gpu::HOGDescriptor::setSVMDetector(const vector<float>& _detector)
void cv::gpu::HOGDescriptor::setSVMDetector(const std::vector<float>& _detector)
{
std::vector<float> detector_reordered(_detector.size());
@@ -264,8 +264,8 @@ void cv::gpu::HOGDescriptor::getDescriptors(const GpuMat& img, Size win_stride,
}
}
void cv::gpu::HOGDescriptor::computeConfidence(const GpuMat& img, vector<Point>& hits, double hit_threshold,
Size win_stride, Size padding, vector<Point>& locations, vector<double>& confidences)
void cv::gpu::HOGDescriptor::computeConfidence(const GpuMat& img, std::vector<Point>& hits, double hit_threshold,
Size win_stride, Size padding, std::vector<Point>& locations, std::vector<double>& confidences)
{
CV_Assert(padding == Size(0, 0));
@@ -307,11 +307,11 @@ void cv::gpu::HOGDescriptor::computeConfidence(const GpuMat& img, vector<Point>&
}
}
void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vector<Rect>& found_locations,
void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, std::vector<Rect>& found_locations,
double hit_threshold, Size win_stride, Size padding,
vector<HOGConfidence> &conf_out, int group_threshold)
std::vector<HOGConfidence> &conf_out, int group_threshold)
{
vector<double> level_scale;
std::vector<double> level_scale;
double scale = 1.;
int levels = 0;
@@ -327,7 +327,7 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
level_scale.resize(levels);
std::vector<Rect> all_candidates;
vector<Point> locations;
std::vector<Point> locations;
for (size_t i = 0; i < level_scale.size(); i++)
{
@@ -359,7 +359,7 @@ void cv::gpu::HOGDescriptor::computeConfidenceMultiScale(const GpuMat& img, vect
}
void cv::gpu::HOGDescriptor::detect(const GpuMat& img, vector<Point>& hits, double hit_threshold, Size win_stride, Size padding)
void cv::gpu::HOGDescriptor::detect(const GpuMat& img, std::vector<Point>& hits, double hit_threshold, Size win_stride, Size padding)
{
CV_Assert(img.type() == CV_8UC1 || img.type() == CV_8UC4);
CV_Assert(padding == Size(0, 0));
@@ -396,13 +396,13 @@ void cv::gpu::HOGDescriptor::detect(const GpuMat& img, vector<Point>& hits, doub
void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat& img, vector<Rect>& found_locations, double hit_threshold,
void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat& img, std::vector<Rect>& found_locations, double hit_threshold,
Size win_stride, Size padding, double scale0, int group_threshold)
{
CV_Assert(img.type() == CV_8UC1 || img.type() == CV_8UC4);
vector<double> level_scale;
std::vector<double> level_scale;
double scale = 1.;
int levels = 0;
@@ -419,7 +419,7 @@ void cv::gpu::HOGDescriptor::detectMultiScale(const GpuMat& img, vector<Rect>& f
image_scales.resize(levels);
std::vector<Rect> all_candidates;
vector<Point> locations;
std::vector<Point> locations;
for (size_t i = 0; i < level_scale.size(); i++)
{
@@ -799,7 +799,7 @@ std::vector<float> cv::gpu::HOGDescriptor::getPeopleDetector48x96()
-0.119002f, 0.026722f, 0.034853f, -0.060934f, -0.025054f, -0.093026f,
-0.035372f, -0.233209f, -0.049869f, -0.039151f, -0.022279f, -0.065380f,
-9.063785f };
return vector<float>(detector, detector + sizeof(detector)/sizeof(detector[0]));
return std::vector<float>(detector, detector + sizeof(detector)/sizeof(detector[0]));
}
@@ -1613,7 +1613,7 @@ std::vector<float> cv::gpu::HOGDescriptor::getPeopleDetector64x128()
-0.01612278f, -1.46097376e-003f, 0.14013411f, -8.96181818e-003f,
-0.03250246f, 3.38630192e-003f, 2.64779478e-003f, 0.03359732f,
-0.02411991f, -0.04229729f, 0.10666174f, -6.66579151f };
return vector<float>(detector, detector + sizeof(detector)/sizeof(detector[0]));
return std::vector<float>(detector, detector + sizeof(detector)/sizeof(detector[0]));
}
#endif

View File

@@ -42,7 +42,6 @@
#include "precomp.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;
@@ -311,7 +310,7 @@ void cv::gpu::HoughCircles(const GpuMat& src, GpuMat& circles, HoughCirclesBuf&
{
for (int xx = x1; xx <= x2; ++xx)
{
vector<ushort2>& m = grid[yy * gridWidth + xx];
std::vector<ushort2>& m = grid[yy * gridWidth + xx];
for(size_t j = 0; j < m.size(); ++j)
{
@@ -434,9 +433,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);
}
@@ -476,11 +475,11 @@ namespace
GpuMat outBuf;
int posCount;
vector<float4> oldPosBuf;
vector<int3> oldVoteBuf;
vector<float4> newPosBuf;
vector<int3> newVoteBuf;
vector<int> indexies;
std::vector<float4> oldPosBuf;
std::vector<int3> oldVoteBuf;
std::vector<float4> newPosBuf;
std::vector<int3> newVoteBuf;
std::vector<int> indexies;
};
GHT_Pos::GHT_Pos()
@@ -610,7 +609,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;
@@ -640,7 +639,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)
{
@@ -1060,11 +1059,11 @@ namespace
Feature templFeatures;
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;
GpuMat hist;
vector<int> h_buf;
std::vector<int> h_buf;
};
CV_INIT_ALGORITHM(GHT_Guil_Full, "GeneralizedHough_GPU.POSITION_SCALE_ROTATION",
@@ -1278,7 +1277,7 @@ namespace
if (h_buf[n] >= angleThresh)
{
const double angle = minAngle + n * angleStep;
angles.push_back(make_pair(angle, h_buf[n]));
angles.push_back(std::make_pair(angle, h_buf[n]));
}
}
}
@@ -1302,7 +1301,7 @@ namespace
if (h_buf[s] >= scaleThresh)
{
const double scale = minScale + s * scaleStep;
scales.push_back(make_pair(scale, h_buf[s]));
scales.push_back(std::make_pair(scale, h_buf[s]));
}
}
}

View File

@@ -44,7 +44,6 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)

View File

@@ -48,8 +48,6 @@ void cv::gpu::meanShiftSegmentation(const GpuMat&, Mat&, int, int, int, TermCrit
#else
using namespace std;
// Auxiliray stuff
namespace
{
@@ -65,9 +63,9 @@ public:
int find(int elem);
int merge(int set1, int set2);
vector<int> parent;
vector<int> rank;
vector<int> size;
std::vector<int> parent;
std::vector<int> rank;
std::vector<int> size;
private:
DjSets(const DjSets&);
void operator =(const DjSets&);
@@ -95,8 +93,8 @@ public:
void addEdge(int from, int to, const T& val=T());
vector<int> start;
vector<Edge> edges;
std::vector<int> start;
std::vector<Edge> edges;
int numv;
int nume_max;
@@ -324,7 +322,7 @@ void cv::gpu::meanShiftSegmentation(const GpuMat& src, Mat& dst, int sp, int sr,
}
}
vector<SegmLink> edges;
std::vector<SegmLink> edges;
edges.reserve(g.numv);
// Prepare edges connecting differnet components
@@ -353,7 +351,7 @@ void cv::gpu::meanShiftSegmentation(const GpuMat& src, Mat& dst, int sp, int sr,
// Compute sum of the pixel's colors which are in the same segment
Mat h_src(src);
vector<Vec4i> sumcols(nrows * ncols, Vec4i(0, 0, 0, 0));
std::vector<Vec4i> sumcols(nrows * ncols, Vec4i(0, 0, 0, 0));
for (int y = 0; y < nrows; ++y)
{
Vec4b* h_srcy = h_src.ptr<Vec4b>(y);

View File

@@ -42,7 +42,6 @@
#include "precomp.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;
@@ -72,7 +71,7 @@ void cv::gpu::calcOpticalFlowBM(const GpuMat& prev, const GpuMat& curr, Size blo
vely.create(velSize, CV_32FC1);
// scanning scheme coordinates
vector<short2> ss((2 * maxRange.width + 1) * (2 * maxRange.height + 1));
std::vector<short2> ss((2 * maxRange.width + 1) * (2 * maxRange.height + 1));
int ssCount = 0;
// Calculate scanning scheme

View File

@@ -44,7 +44,6 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)

View File

@@ -50,7 +50,6 @@
// leads to an inefficient code. It's for debug purposes only.
#define ENABLE_GPU_RESIZE 1
using namespace std;
using namespace cv;
using namespace cv::gpu;
@@ -153,7 +152,7 @@ void cv::gpu::FarnebackOpticalFlow::prepareGaussian(
void cv::gpu::FarnebackOpticalFlow::setPolynomialExpansionConsts(int n, double sigma)
{
vector<float> buf(n*6 + 3);
std::vector<float> buf(n*6 + 3);
float* g = &buf[0] + n;
float* xg = g + n*2 + 1;
float* xxg = xg + n*2 + 1;

View File

@@ -42,7 +42,6 @@
#include "precomp.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;
@@ -419,7 +418,7 @@ cv::gpu::ORB_GPU::ORB_GPU(int nFeatures, float scaleFactor, int nLevels, int edg
// pre-compute the end of a row in a circular patch
int half_patch_size = patchSize_ / 2;
vector<int> u_max(half_patch_size + 2);
std::vector<int> u_max(half_patch_size + 2);
for (int v = 0; v <= half_patch_size * std::sqrt(2.f) / 2 + 1; ++v)
u_max[v] = cvRound(std::sqrt(static_cast<float>(half_patch_size * half_patch_size - v * v)));

View File

@@ -42,7 +42,6 @@
#include "precomp.hpp"
using namespace std;
using namespace cv;
using namespace cv::gpu;

View File

@@ -121,17 +121,17 @@ struct cv::gpu::SCascade::Fields
static const char *const SC_F_RECT = "rect";
// only Ada Boost supported
std::string stageTypeStr = (string)root[SC_STAGE_TYPE];
std::string stageTypeStr = (std::string)root[SC_STAGE_TYPE];
CV_Assert(stageTypeStr == SC_BOOST);
// only HOG-like integral channel features supported
string featureTypeStr = (string)root[SC_FEATURE_TYPE];
std::string featureTypeStr = (std::string)root[SC_FEATURE_TYPE];
CV_Assert(featureTypeStr == SC_ICF);
int origWidth = (int)root[SC_ORIG_W];
int origHeight = (int)root[SC_ORIG_H];
std::string fformat = (string)root[SC_FEATURE_FORMAT];
std::string fformat = (std::string)root[SC_FEATURE_FORMAT];
bool useBoxes = (fformat == "BOX");
ushort shrinkage = cv::saturate_cast<ushort>((int)root[SC_SHRINKAGE]);

View File

@@ -64,7 +64,7 @@ void cv::filterSpeckles( Mat& img, uchar newVal, int maxSpeckleSize, uchar maxDi
(img.rows + WinSz + 2)*sizeof(int) +
(img.rows+WinSz+2)*MaxD*(WinSz+1)*sizeof(uchar) + 256;
int bufSize1 = (img.cols + 9 + 2) * sizeof(int) + 256;
int bufSz = max(bufSize0 * 1, bufSize1 * 2);
int bufSz = std::max(bufSize0 * 1, bufSize1 * 2);
_buf.create(1, bufSz, CV_8U);

View File

@@ -44,14 +44,13 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
void cv::gpu::merge(const GpuMat* /*src*/, size_t /*count*/, GpuMat& /*dst*/, Stream& /*stream*/) { throw_nogpu(); }
void cv::gpu::merge(const vector<GpuMat>& /*src*/, GpuMat& /*dst*/, Stream& /*stream*/) { throw_nogpu(); }
void cv::gpu::merge(const std::vector<GpuMat>& /*src*/, GpuMat& /*dst*/, Stream& /*stream*/) { throw_nogpu(); }
void cv::gpu::split(const GpuMat& /*src*/, GpuMat* /*dst*/, Stream& /*stream*/) { throw_nogpu(); }
void cv::gpu::split(const GpuMat& /*src*/, vector<GpuMat>& /*dst*/, Stream& /*stream*/) { throw_nogpu(); }
void cv::gpu::split(const GpuMat& /*src*/, std::vector<GpuMat>& /*dst*/, Stream& /*stream*/) { throw_nogpu(); }
#else /* !defined (HAVE_CUDA) */
@@ -152,7 +151,7 @@ void cv::gpu::merge(const GpuMat* src, size_t n, GpuMat& dst, Stream& stream)
}
void cv::gpu::merge(const vector<GpuMat>& src, GpuMat& dst, Stream& stream)
void cv::gpu::merge(const std::vector<GpuMat>& src, GpuMat& dst, Stream& stream)
{
::merge(&src[0], src.size(), dst, StreamAccessor::getStream(stream));
}
@@ -162,7 +161,7 @@ void cv::gpu::split(const GpuMat& src, GpuMat* dst, Stream& stream)
::split(src, dst, StreamAccessor::getStream(stream));
}
void cv::gpu::split(const GpuMat& src, vector<GpuMat>& dst, Stream& stream)
void cv::gpu::split(const GpuMat& src, std::vector<GpuMat>& dst, Stream& stream)
{
dst.resize(src.channels());
if(src.channels() > 0)

View File

@@ -44,7 +44,6 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
@@ -95,7 +94,7 @@ void cv::gpu::StereoBeliefPropagation::estimateRecommendedParams(int width, int
if ((ndisp & 1) != 0)
ndisp++;
int mm = ::max(width, height);
int mm = std::max(width, height);
iters = mm / 100 + 2;
levels = (int)(::log(static_cast<double>(mm)) + 1) * 4 / 5;
@@ -126,13 +125,13 @@ namespace
StereoBeliefPropagationImpl(StereoBeliefPropagation& rthis_,
GpuMat& u_, GpuMat& d_, GpuMat& l_, GpuMat& r_,
GpuMat& u2_, GpuMat& d2_, GpuMat& l2_, GpuMat& r2_,
vector<GpuMat>& datas_, GpuMat& out_)
std::vector<GpuMat>& datas_, GpuMat& out_)
: rthis(rthis_), u(u_), d(d_), l(l_), r(r_), u2(u2_), d2(d2_), l2(l2_), r2(r2_), datas(datas_), out(out_),
zero(Scalar::all(0)), scale(rthis_.msg_type == CV_32F ? 1.0f : 10.0f)
{
CV_Assert(0 < rthis.ndisp && 0 < rthis.iters && 0 < rthis.levels);
CV_Assert(rthis.msg_type == CV_32F || rthis.msg_type == CV_16S);
CV_Assert(rthis.msg_type == CV_32F || (1 << (rthis.levels - 1)) * scale * rthis.max_data_term < numeric_limits<short>::max());
CV_Assert(rthis.msg_type == CV_32F || (1 << (rthis.levels - 1)) * scale * rthis.max_data_term < std::numeric_limits<short>::max());
}
void operator()(const GpuMat& left, const GpuMat& right, GpuMat& disp, Stream& stream)
@@ -154,7 +153,7 @@ namespace
int lowest_cols = cols / divisor;
int lowest_rows = rows / divisor;
const int min_image_dim_size = 2;
CV_Assert(min(lowest_cols, lowest_rows) > min_image_dim_size);
CV_Assert(std::min(lowest_cols, lowest_rows) > min_image_dim_size);
init(stream);
@@ -176,7 +175,7 @@ namespace
int lowest_cols = cols / divisor;
int lowest_rows = rows / divisor;
const int min_image_dim_size = 2;
CV_Assert(min(lowest_cols, lowest_rows) > min_image_dim_size);
CV_Assert(std::min(lowest_cols, lowest_rows) > min_image_dim_size);
init(stream);
@@ -342,7 +341,7 @@ namespace
GpuMat& l2;
GpuMat& r2;
vector<GpuMat>& datas;
std::vector<GpuMat>& datas;
GpuMat& out;
const Scalar zero;
@@ -350,7 +349,7 @@ namespace
int rows, cols;
vector<int> cols_all, rows_all;
std::vector<int> cols_all, rows_all;
};
}

View File

@@ -44,7 +44,6 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
@@ -105,7 +104,7 @@ void cv::gpu::StereoConstantSpaceBP::estimateRecommendedParams(int width, int he
if ((ndisp & 1) != 0)
ndisp++;
int mm = ::max(width, height);
int mm = std::max(width, height);
iters = mm / 100 + ((mm > 1200)? - 4 : 4);
levels = (int)::log(static_cast<double>(mm)) * 2 / 3;
@@ -154,7 +153,7 @@ static void csbp_operator(StereoConstantSpaceBP& rthis, GpuMat& mbuf, GpuMat& te
int rows = left.rows;
int cols = left.cols;
rthis.levels = min(rthis.levels, int(log((double)rthis.ndisp) / log(2.0)));
rthis.levels = std::min(rthis.levels, int(log((double)rthis.ndisp) / log(2.0)));
int levels = rthis.levels;
// compute sizes

View File

@@ -44,21 +44,20 @@
using namespace cv;
using namespace cv::gpu;
using namespace std;
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
cv::gpu::SURF_GPU::SURF_GPU() { throw_nogpu(); }
cv::gpu::SURF_GPU::SURF_GPU(double, int, int, bool, float, bool) { throw_nogpu(); }
int cv::gpu::SURF_GPU::descriptorSize() const { throw_nogpu(); return 0;}
void cv::gpu::SURF_GPU::uploadKeypoints(const vector<KeyPoint>&, GpuMat&) { throw_nogpu(); }
void cv::gpu::SURF_GPU::downloadKeypoints(const GpuMat&, vector<KeyPoint>&) { throw_nogpu(); }
void cv::gpu::SURF_GPU::downloadDescriptors(const GpuMat&, vector<float>&) { throw_nogpu(); }
void cv::gpu::SURF_GPU::uploadKeypoints(const std::vector<KeyPoint>&, GpuMat&) { throw_nogpu(); }
void cv::gpu::SURF_GPU::downloadKeypoints(const GpuMat&, std::vector<KeyPoint>&) { throw_nogpu(); }
void cv::gpu::SURF_GPU::downloadDescriptors(const GpuMat&, std::vector<float>&) { throw_nogpu(); }
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, GpuMat&) { throw_nogpu(); }
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, GpuMat&, GpuMat&, bool) { throw_nogpu(); }
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, vector<KeyPoint>&) { throw_nogpu(); }
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, vector<KeyPoint>&, GpuMat&, bool) { throw_nogpu(); }
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, vector<KeyPoint>&, vector<float>&, bool) { throw_nogpu(); }
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&) { throw_nogpu(); }
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&, GpuMat&, bool) { throw_nogpu(); }
void cv::gpu::SURF_GPU::operator()(const GpuMat&, const GpuMat&, std::vector<KeyPoint>&, std::vector<float>&, bool) { throw_nogpu(); }
void cv::gpu::SURF_GPU::releaseMemory() { throw_nogpu(); }
#else /* !defined (HAVE_CUDA) */
@@ -131,8 +130,8 @@ namespace
CV_Assert(layer_rows - 2 * min_margin > 0);
CV_Assert(layer_cols - 2 * min_margin > 0);
maxFeatures = min(static_cast<int>(img.size().area() * surf.keypointsRatio), 65535);
maxCandidates = min(static_cast<int>(1.5 * maxFeatures), 65535);
maxFeatures = std::min(static_cast<int>(img.size().area() * surf.keypointsRatio), 65535);
maxCandidates = std::min(static_cast<int>(1.5 * maxFeatures), 65535);
CV_Assert(maxFeatures > 0);
@@ -263,7 +262,7 @@ int cv::gpu::SURF_GPU::descriptorSize() const
return extended ? 128 : 64;
}
void cv::gpu::SURF_GPU::uploadKeypoints(const vector<KeyPoint>& keypoints, GpuMat& keypointsGPU)
void cv::gpu::SURF_GPU::uploadKeypoints(const std::vector<KeyPoint>& keypoints, GpuMat& keypointsGPU)
{
if (keypoints.empty())
keypointsGPU.release();
@@ -295,7 +294,7 @@ void cv::gpu::SURF_GPU::uploadKeypoints(const vector<KeyPoint>& keypoints, GpuMa
}
}
void cv::gpu::SURF_GPU::downloadKeypoints(const GpuMat& keypointsGPU, vector<KeyPoint>& keypoints)
void cv::gpu::SURF_GPU::downloadKeypoints(const GpuMat& keypointsGPU, std::vector<KeyPoint>& keypoints)
{
const int nFeatures = keypointsGPU.cols;
@@ -331,7 +330,7 @@ void cv::gpu::SURF_GPU::downloadKeypoints(const GpuMat& keypointsGPU, vector<Key
}
}
void cv::gpu::SURF_GPU::downloadDescriptors(const GpuMat& descriptorsGPU, vector<float>& descriptors)
void cv::gpu::SURF_GPU::downloadDescriptors(const GpuMat& descriptorsGPU, std::vector<float>& descriptors)
{
if (descriptorsGPU.empty())
descriptors.clear();
@@ -373,7 +372,7 @@ void cv::gpu::SURF_GPU::operator()(const GpuMat& img, const GpuMat& mask, GpuMat
}
}
void cv::gpu::SURF_GPU::operator()(const GpuMat& img, const GpuMat& mask, vector<KeyPoint>& keypoints)
void cv::gpu::SURF_GPU::operator()(const GpuMat& img, const GpuMat& mask, std::vector<KeyPoint>& keypoints)
{
GpuMat keypointsGPU;
@@ -382,7 +381,7 @@ void cv::gpu::SURF_GPU::operator()(const GpuMat& img, const GpuMat& mask, vector
downloadKeypoints(keypointsGPU, keypoints);
}
void cv::gpu::SURF_GPU::operator()(const GpuMat& img, const GpuMat& mask, vector<KeyPoint>& keypoints,
void cv::gpu::SURF_GPU::operator()(const GpuMat& img, const GpuMat& mask, std::vector<KeyPoint>& keypoints,
GpuMat& descriptors, bool useProvidedKeypoints)
{
GpuMat keypointsGPU;
@@ -395,8 +394,8 @@ void cv::gpu::SURF_GPU::operator()(const GpuMat& img, const GpuMat& mask, vector
downloadKeypoints(keypointsGPU, keypoints);
}
void cv::gpu::SURF_GPU::operator()(const GpuMat& img, const GpuMat& mask, vector<KeyPoint>& keypoints,
vector<float>& descriptors, bool useProvidedKeypoints)
void cv::gpu::SURF_GPU::operator()(const GpuMat& img, const GpuMat& mask, std::vector<KeyPoint>& keypoints,
std::vector<float>& descriptors, bool useProvidedKeypoints)
{
GpuMat descriptorsGPU;

View File

@@ -51,7 +51,6 @@ void cv::gpu::OpticalFlowDual_TVL1_GPU::procOneScale(const GpuMat&, const GpuMat
#else
using namespace std;
using namespace cv;
using namespace cv::gpu;
@@ -215,7 +214,7 @@ void cv::gpu::OpticalFlowDual_TVL1_GPU::procOneScale(const GpuMat& I0, const Gpu
{
warpBackward(I0, I1, I1x, I1y, u1, u2, I1w, I1wx, I1wy, grad, rho_c);
double error = numeric_limits<double>::max();
double error = std::numeric_limits<double>::max();
for (int n = 0; error > scaledEpsilon && n < iterations; ++n)
{
estimateU(I1wx, I1wy, grad, rho_c, p11, p12, p21, p22, u1, u2, diff, l_t, static_cast<float>(theta));