mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
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:
+77
-81
@@ -60,10 +60,6 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace cv;
|
||||
using namespace cv::gpu;
|
||||
|
||||
//////////////////////////////// Initialization & Info ////////////////////////
|
||||
|
||||
namespace
|
||||
@@ -73,7 +69,7 @@ namespace
|
||||
public:
|
||||
CudaArch();
|
||||
|
||||
bool builtWith(FeatureSet feature_set) const;
|
||||
bool builtWith(cv::gpu::FeatureSet feature_set) const;
|
||||
bool hasPtx(int major, int minor) const;
|
||||
bool hasBin(int major, int minor) const;
|
||||
bool hasEqualOrLessPtx(int major, int minor) const;
|
||||
@@ -81,11 +77,11 @@ namespace
|
||||
bool hasEqualOrGreaterBin(int major, int minor) const;
|
||||
|
||||
private:
|
||||
static void fromStr(const string& set_as_str, vector<int>& arr);
|
||||
static void fromStr(const std::string& set_as_str, std::vector<int>& arr);
|
||||
|
||||
vector<int> bin;
|
||||
vector<int> ptx;
|
||||
vector<int> features;
|
||||
std::vector<int> bin;
|
||||
std::vector<int> ptx;
|
||||
std::vector<int> features;
|
||||
};
|
||||
|
||||
const CudaArch cudaArch;
|
||||
@@ -99,19 +95,19 @@ namespace
|
||||
#endif
|
||||
}
|
||||
|
||||
bool CudaArch::builtWith(FeatureSet feature_set) const
|
||||
bool CudaArch::builtWith(cv::gpu::FeatureSet feature_set) const
|
||||
{
|
||||
return !features.empty() && (features.back() >= feature_set);
|
||||
}
|
||||
|
||||
bool CudaArch::hasPtx(int major, int minor) const
|
||||
{
|
||||
return find(ptx.begin(), ptx.end(), major * 10 + minor) != ptx.end();
|
||||
return std::find(ptx.begin(), ptx.end(), major * 10 + minor) != ptx.end();
|
||||
}
|
||||
|
||||
bool CudaArch::hasBin(int major, int minor) const
|
||||
{
|
||||
return find(bin.begin(), bin.end(), major * 10 + minor) != bin.end();
|
||||
return std::find(bin.begin(), bin.end(), major * 10 + minor) != bin.end();
|
||||
}
|
||||
|
||||
bool CudaArch::hasEqualOrLessPtx(int major, int minor) const
|
||||
@@ -129,12 +125,12 @@ namespace
|
||||
return !bin.empty() && (bin.back() >= major * 10 + minor);
|
||||
}
|
||||
|
||||
void CudaArch::fromStr(const string& set_as_str, vector<int>& arr)
|
||||
void CudaArch::fromStr(const std::string& set_as_str, std::vector<int>& arr)
|
||||
{
|
||||
if (set_as_str.find_first_not_of(" ") == string::npos)
|
||||
if (set_as_str.find_first_not_of(" ") == std::string::npos)
|
||||
return;
|
||||
|
||||
istringstream stream(set_as_str);
|
||||
std::istringstream stream(set_as_str);
|
||||
int cur_value;
|
||||
|
||||
while (!stream.eof())
|
||||
@@ -143,7 +139,7 @@ namespace
|
||||
arr.push_back(cur_value);
|
||||
}
|
||||
|
||||
sort(arr.begin(), arr.end());
|
||||
std::sort(arr.begin(), arr.end());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -646,7 +642,7 @@ cv::gpu::GpuMat::GpuMat(const Mat& m) :
|
||||
upload(m);
|
||||
}
|
||||
|
||||
GpuMat& cv::gpu::GpuMat::operator = (const GpuMat& m)
|
||||
cv::gpu::GpuMat& cv::gpu::GpuMat::operator = (const cv::gpu::GpuMat& m)
|
||||
{
|
||||
if (this != &m)
|
||||
{
|
||||
@@ -693,7 +689,7 @@ void cv::gpu::GpuMat::locateROI(Size& wholeSize, Point& ofs) const
|
||||
wholeSize.width = std::max(static_cast<int>((delta2 - step * (wholeSize.height - 1)) / esz), ofs.x + cols);
|
||||
}
|
||||
|
||||
GpuMat& cv::gpu::GpuMat::adjustROI(int dtop, int dbottom, int dleft, int dright)
|
||||
cv::gpu::GpuMat& cv::gpu::GpuMat::adjustROI(int dtop, int dbottom, int dleft, int dright)
|
||||
{
|
||||
Size wholeSize;
|
||||
Point ofs;
|
||||
@@ -719,7 +715,7 @@ GpuMat& cv::gpu::GpuMat::adjustROI(int dtop, int dbottom, int dleft, int dright)
|
||||
return *this;
|
||||
}
|
||||
|
||||
GpuMat cv::gpu::GpuMat::reshape(int new_cn, int new_rows) const
|
||||
cv::gpu::GpuMat cv::gpu::GpuMat::reshape(int new_cn, int new_rows) const
|
||||
{
|
||||
GpuMat hdr = *this;
|
||||
|
||||
@@ -762,7 +758,7 @@ GpuMat cv::gpu::GpuMat::reshape(int new_cn, int new_rows) const
|
||||
return hdr;
|
||||
}
|
||||
|
||||
cv::Mat::Mat(const GpuMat& m) : flags(0), dims(0), rows(0), cols(0), data(0), refcount(0), datastart(0), dataend(0), datalimit(0), allocator(0), size(&rows)
|
||||
cv::Mat::Mat(const cv::gpu::GpuMat& m) : flags(0), dims(0), rows(0), cols(0), data(0), refcount(0), datastart(0), dataend(0), datalimit(0), allocator(0), size(&rows)
|
||||
{
|
||||
m.download(*this);
|
||||
}
|
||||
@@ -804,7 +800,7 @@ void cv::gpu::ensureSizeIsEnough(int rows, int cols, int type, GpuMat& m)
|
||||
}
|
||||
}
|
||||
|
||||
GpuMat cv::gpu::allocMatFromBuf(int rows, int cols, int type, GpuMat &mat)
|
||||
cv::gpu::GpuMat cv::gpu::allocMatFromBuf(int rows, int cols, int type, GpuMat &mat)
|
||||
{
|
||||
if (!mat.empty() && mat.type() == type && mat.rows >= rows && mat.cols >= cols)
|
||||
return mat(Rect(0, 0, cols, rows));
|
||||
@@ -818,16 +814,16 @@ namespace
|
||||
public:
|
||||
virtual ~GpuFuncTable() {}
|
||||
|
||||
virtual void copy(const Mat& src, GpuMat& dst) const = 0;
|
||||
virtual void copy(const GpuMat& src, Mat& dst) const = 0;
|
||||
virtual void copy(const GpuMat& src, GpuMat& dst) const = 0;
|
||||
virtual void copy(const cv::Mat& src, cv::gpu::GpuMat& dst) const = 0;
|
||||
virtual void copy(const cv::gpu::GpuMat& src, cv::Mat& dst) const = 0;
|
||||
virtual void copy(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst) const = 0;
|
||||
|
||||
virtual void copyWithMask(const GpuMat& src, GpuMat& dst, const GpuMat& mask) const = 0;
|
||||
virtual void copyWithMask(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst, const cv::gpu::GpuMat& mask) const = 0;
|
||||
|
||||
virtual void convert(const GpuMat& src, GpuMat& dst) const = 0;
|
||||
virtual void convert(const GpuMat& src, GpuMat& dst, double alpha, double beta) const = 0;
|
||||
virtual void convert(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst) const = 0;
|
||||
virtual void convert(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst, double alpha, double beta) const = 0;
|
||||
|
||||
virtual void setTo(GpuMat& m, Scalar s, const GpuMat& mask) const = 0;
|
||||
virtual void setTo(cv::gpu::GpuMat& m, cv::Scalar s, const cv::gpu::GpuMat& mask) const = 0;
|
||||
|
||||
virtual void mallocPitch(void** devPtr, size_t* step, size_t width, size_t height) const = 0;
|
||||
virtual void free(void* devPtr) const = 0;
|
||||
@@ -841,16 +837,16 @@ namespace
|
||||
class EmptyFuncTable : public GpuFuncTable
|
||||
{
|
||||
public:
|
||||
void copy(const Mat&, GpuMat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void copy(const GpuMat&, Mat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void copy(const GpuMat&, GpuMat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void copy(const cv::Mat&, cv::gpu::GpuMat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void copy(const cv::gpu::GpuMat&, cv::Mat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void copy(const cv::gpu::GpuMat&, cv::gpu::GpuMat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
|
||||
void copyWithMask(const GpuMat&, GpuMat&, const GpuMat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void copyWithMask(const cv::gpu::GpuMat&, cv::gpu::GpuMat&, const cv::gpu::GpuMat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
|
||||
void convert(const GpuMat&, GpuMat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void convert(const GpuMat&, GpuMat&, double, double) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void convert(const cv::gpu::GpuMat&, cv::gpu::GpuMat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void convert(const cv::gpu::GpuMat&, cv::gpu::GpuMat&, double, double) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
|
||||
void setTo(GpuMat&, Scalar, const GpuMat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void setTo(cv::gpu::GpuMat&, cv::Scalar, const cv::gpu::GpuMat&) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
|
||||
void mallocPitch(void**, size_t*, size_t, size_t) const { CV_Error(CV_GpuNotSupported, "The library is compiled without CUDA support"); }
|
||||
void free(void*) const {}
|
||||
@@ -880,15 +876,15 @@ namespace cv { namespace gpu { namespace device
|
||||
|
||||
namespace
|
||||
{
|
||||
template <typename T> void kernelSetCaller(GpuMat& src, Scalar s, cudaStream_t stream)
|
||||
template <typename T> void kernelSetCaller(cv::gpu::GpuMat& src, cv::Scalar s, cudaStream_t stream)
|
||||
{
|
||||
Scalar_<T> sf = s;
|
||||
cv::Scalar_<T> sf = s;
|
||||
cv::gpu::device::set_to_gpu(src, sf.val, src.channels(), stream);
|
||||
}
|
||||
|
||||
template <typename T> void kernelSetCaller(GpuMat& src, Scalar s, const GpuMat& mask, cudaStream_t stream)
|
||||
template <typename T> void kernelSetCaller(cv::gpu::GpuMat& src, cv::Scalar s, const cv::gpu::GpuMat& mask, cudaStream_t stream)
|
||||
{
|
||||
Scalar_<T> sf = s;
|
||||
cv::Scalar_<T> sf = s;
|
||||
cv::gpu::device::set_to_gpu(src, sf.val, mask, src.channels(), stream);
|
||||
}
|
||||
}
|
||||
@@ -996,7 +992,7 @@ namespace
|
||||
typedef typename NPPTypeTraits<SDEPTH>::npp_type src_t;
|
||||
typedef typename NPPTypeTraits<DDEPTH>::npp_type dst_t;
|
||||
|
||||
static void call(const GpuMat& src, GpuMat& dst)
|
||||
static void call(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst)
|
||||
{
|
||||
NppiSize sz;
|
||||
sz.width = src.cols;
|
||||
@@ -1011,7 +1007,7 @@ namespace
|
||||
{
|
||||
typedef typename NPPTypeTraits<DDEPTH>::npp_type dst_t;
|
||||
|
||||
static void call(const GpuMat& src, GpuMat& dst)
|
||||
static void call(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst)
|
||||
{
|
||||
NppiSize sz;
|
||||
sz.width = src.cols;
|
||||
@@ -1051,13 +1047,13 @@ namespace
|
||||
{
|
||||
typedef typename NPPTypeTraits<SDEPTH>::npp_type src_t;
|
||||
|
||||
static void call(GpuMat& src, Scalar s)
|
||||
static void call(cv::gpu::GpuMat& src, cv::Scalar s)
|
||||
{
|
||||
NppiSize sz;
|
||||
sz.width = src.cols;
|
||||
sz.height = src.rows;
|
||||
|
||||
Scalar_<src_t> nppS = s;
|
||||
cv::Scalar_<src_t> nppS = s;
|
||||
|
||||
nppSafeCall( func(nppS.val, src.ptr<src_t>(), static_cast<int>(src.step), sz) );
|
||||
|
||||
@@ -1068,13 +1064,13 @@ namespace
|
||||
{
|
||||
typedef typename NPPTypeTraits<SDEPTH>::npp_type src_t;
|
||||
|
||||
static void call(GpuMat& src, Scalar s)
|
||||
static void call(cv::gpu::GpuMat& src, cv::Scalar s)
|
||||
{
|
||||
NppiSize sz;
|
||||
sz.width = src.cols;
|
||||
sz.height = src.rows;
|
||||
|
||||
Scalar_<src_t> nppS = s;
|
||||
cv::Scalar_<src_t> nppS = s;
|
||||
|
||||
nppSafeCall( func(nppS[0], src.ptr<src_t>(), static_cast<int>(src.step), sz) );
|
||||
|
||||
@@ -1099,13 +1095,13 @@ namespace
|
||||
{
|
||||
typedef typename NPPTypeTraits<SDEPTH>::npp_type src_t;
|
||||
|
||||
static void call(GpuMat& src, Scalar s, const GpuMat& mask)
|
||||
static void call(cv::gpu::GpuMat& src, cv::Scalar s, const cv::gpu::GpuMat& mask)
|
||||
{
|
||||
NppiSize sz;
|
||||
sz.width = src.cols;
|
||||
sz.height = src.rows;
|
||||
|
||||
Scalar_<src_t> nppS = s;
|
||||
cv::Scalar_<src_t> nppS = s;
|
||||
|
||||
nppSafeCall( func(nppS.val, src.ptr<src_t>(), static_cast<int>(src.step), sz, mask.ptr<Npp8u>(), static_cast<int>(mask.step)) );
|
||||
|
||||
@@ -1116,13 +1112,13 @@ namespace
|
||||
{
|
||||
typedef typename NPPTypeTraits<SDEPTH>::npp_type src_t;
|
||||
|
||||
static void call(GpuMat& src, Scalar s, const GpuMat& mask)
|
||||
static void call(cv::gpu::GpuMat& src, cv::Scalar s, const cv::gpu::GpuMat& mask)
|
||||
{
|
||||
NppiSize sz;
|
||||
sz.width = src.cols;
|
||||
sz.height = src.rows;
|
||||
|
||||
Scalar_<src_t> nppS = s;
|
||||
cv::Scalar_<src_t> nppS = s;
|
||||
|
||||
nppSafeCall( func(nppS[0], src.ptr<src_t>(), static_cast<int>(src.step), sz, mask.ptr<Npp8u>(), static_cast<int>(mask.step)) );
|
||||
|
||||
@@ -1144,7 +1140,7 @@ namespace
|
||||
{
|
||||
typedef typename NPPTypeTraits<SDEPTH>::npp_type src_t;
|
||||
|
||||
static void call(const GpuMat& src, GpuMat& dst, const GpuMat& mask, cudaStream_t /*stream*/)
|
||||
static void call(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst, const cv::gpu::GpuMat& mask, cudaStream_t /*stream*/)
|
||||
{
|
||||
NppiSize sz;
|
||||
sz.width = src.cols;
|
||||
@@ -1167,20 +1163,20 @@ namespace
|
||||
class CudaFuncTable : public GpuFuncTable
|
||||
{
|
||||
public:
|
||||
void copy(const Mat& src, GpuMat& dst) const
|
||||
void copy(const cv::Mat& src, cv::gpu::GpuMat& dst) const
|
||||
{
|
||||
cudaSafeCall( cudaMemcpy2D(dst.data, dst.step, src.data, src.step, src.cols * src.elemSize(), src.rows, cudaMemcpyHostToDevice) );
|
||||
}
|
||||
void copy(const GpuMat& src, Mat& dst) const
|
||||
void copy(const cv::gpu::GpuMat& src, cv::Mat& dst) const
|
||||
{
|
||||
cudaSafeCall( cudaMemcpy2D(dst.data, dst.step, src.data, src.step, src.cols * src.elemSize(), src.rows, cudaMemcpyDeviceToHost) );
|
||||
}
|
||||
void copy(const GpuMat& src, GpuMat& dst) const
|
||||
void copy(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst) const
|
||||
{
|
||||
cudaSafeCall( cudaMemcpy2D(dst.data, dst.step, src.data, src.step, src.cols * src.elemSize(), src.rows, cudaMemcpyDeviceToDevice) );
|
||||
}
|
||||
|
||||
void copyWithMask(const GpuMat& src, GpuMat& dst, const GpuMat& mask) const
|
||||
void copyWithMask(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst, const cv::gpu::GpuMat& mask) const
|
||||
{
|
||||
CV_Assert(src.depth() <= CV_64F && src.channels() <= 4);
|
||||
CV_Assert(src.size() == dst.size() && src.type() == dst.type());
|
||||
@@ -1188,11 +1184,11 @@ namespace
|
||||
|
||||
if (src.depth() == CV_64F)
|
||||
{
|
||||
if (!TargetArchs::builtWith(NATIVE_DOUBLE) || !DeviceInfo().supports(NATIVE_DOUBLE))
|
||||
if (!cv::gpu::TargetArchs::builtWith(cv::gpu::NATIVE_DOUBLE) || !cv::gpu::DeviceInfo().supports(cv::gpu::NATIVE_DOUBLE))
|
||||
CV_Error(CV_StsUnsupportedFormat, "The device doesn't support double");
|
||||
}
|
||||
|
||||
typedef void (*func_t)(const GpuMat& src, GpuMat& dst, const GpuMat& mask, cudaStream_t stream);
|
||||
typedef void (*func_t)(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst, const cv::gpu::GpuMat& mask, cudaStream_t stream);
|
||||
static const func_t funcs[7][4] =
|
||||
{
|
||||
/* 8U */ {NppCopyMasked<CV_8U , nppiCopy_8u_C1MR >::call, cv::gpu::copyWithMask, NppCopyMasked<CV_8U , nppiCopy_8u_C3MR >::call, NppCopyMasked<CV_8U , nppiCopy_8u_C4MR >::call},
|
||||
@@ -1209,9 +1205,9 @@ namespace
|
||||
func(src, dst, mask, 0);
|
||||
}
|
||||
|
||||
void convert(const GpuMat& src, GpuMat& dst) const
|
||||
void convert(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst) const
|
||||
{
|
||||
typedef void (*func_t)(const GpuMat& src, GpuMat& dst);
|
||||
typedef void (*func_t)(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst);
|
||||
static const func_t funcs[7][7][4] =
|
||||
{
|
||||
{
|
||||
@@ -1285,7 +1281,7 @@ namespace
|
||||
|
||||
if (src.depth() == CV_64F || dst.depth() == CV_64F)
|
||||
{
|
||||
if (!TargetArchs::builtWith(NATIVE_DOUBLE) || !DeviceInfo().supports(NATIVE_DOUBLE))
|
||||
if (!cv::gpu::TargetArchs::builtWith(cv::gpu::NATIVE_DOUBLE) || !cv::gpu::DeviceInfo().supports(cv::gpu::NATIVE_DOUBLE))
|
||||
CV_Error(CV_StsUnsupportedFormat, "The device doesn't support double");
|
||||
}
|
||||
|
||||
@@ -1302,21 +1298,21 @@ namespace
|
||||
func(src, dst);
|
||||
}
|
||||
|
||||
void convert(const GpuMat& src, GpuMat& dst, double alpha, double beta) const
|
||||
void convert(const cv::gpu::GpuMat& src, cv::gpu::GpuMat& dst, double alpha, double beta) const
|
||||
{
|
||||
CV_Assert(src.depth() <= CV_64F && src.channels() <= 4);
|
||||
CV_Assert(dst.depth() <= CV_64F);
|
||||
|
||||
if (src.depth() == CV_64F || dst.depth() == CV_64F)
|
||||
{
|
||||
if (!TargetArchs::builtWith(NATIVE_DOUBLE) || !DeviceInfo().supports(NATIVE_DOUBLE))
|
||||
if (!cv::gpu::TargetArchs::builtWith(cv::gpu::NATIVE_DOUBLE) || !cv::gpu::DeviceInfo().supports(cv::gpu::NATIVE_DOUBLE))
|
||||
CV_Error(CV_StsUnsupportedFormat, "The device doesn't support double");
|
||||
}
|
||||
|
||||
cv::gpu::convertTo(src, dst, alpha, beta);
|
||||
}
|
||||
|
||||
void setTo(GpuMat& m, Scalar s, const GpuMat& mask) const
|
||||
void setTo(cv::gpu::GpuMat& m, cv::Scalar s, const cv::gpu::GpuMat& mask) const
|
||||
{
|
||||
if (mask.empty())
|
||||
{
|
||||
@@ -1332,13 +1328,13 @@ namespace
|
||||
|
||||
if (cn == 1 || (cn == 2 && s[0] == s[1]) || (cn == 3 && s[0] == s[1] && s[0] == s[2]) || (cn == 4 && s[0] == s[1] && s[0] == s[2] && s[0] == s[3]))
|
||||
{
|
||||
int val = saturate_cast<uchar>(s[0]);
|
||||
int val = cv::saturate_cast<uchar>(s[0]);
|
||||
cudaSafeCall( cudaMemset2D(m.data, m.step, val, m.cols * m.elemSize(), m.rows) );
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
typedef void (*func_t)(GpuMat& src, Scalar s);
|
||||
typedef void (*func_t)(cv::gpu::GpuMat& src, cv::Scalar s);
|
||||
static const func_t funcs[7][4] =
|
||||
{
|
||||
{NppSet<CV_8U , 1, nppiSet_8u_C1R >::call, cv::gpu::setTo , cv::gpu::setTo , NppSet<CV_8U , 4, nppiSet_8u_C4R >::call},
|
||||
@@ -1354,7 +1350,7 @@ namespace
|
||||
|
||||
if (m.depth() == CV_64F)
|
||||
{
|
||||
if (!TargetArchs::builtWith(NATIVE_DOUBLE) || !DeviceInfo().supports(NATIVE_DOUBLE))
|
||||
if (!cv::gpu::TargetArchs::builtWith(cv::gpu::NATIVE_DOUBLE) || !cv::gpu::DeviceInfo().supports(cv::gpu::NATIVE_DOUBLE))
|
||||
CV_Error(CV_StsUnsupportedFormat, "The device doesn't support double");
|
||||
}
|
||||
|
||||
@@ -1362,7 +1358,7 @@ namespace
|
||||
}
|
||||
else
|
||||
{
|
||||
typedef void (*func_t)(GpuMat& src, Scalar s, const GpuMat& mask);
|
||||
typedef void (*func_t)(cv::gpu::GpuMat& src, cv::Scalar s, const cv::gpu::GpuMat& mask);
|
||||
static const func_t funcs[7][4] =
|
||||
{
|
||||
{NppSetMask<CV_8U , 1, nppiSet_8u_C1MR >::call, cv::gpu::setTo, cv::gpu::setTo, NppSetMask<CV_8U , 4, nppiSet_8u_C4MR >::call},
|
||||
@@ -1378,7 +1374,7 @@ namespace
|
||||
|
||||
if (m.depth() == CV_64F)
|
||||
{
|
||||
if (!TargetArchs::builtWith(NATIVE_DOUBLE) || !DeviceInfo().supports(NATIVE_DOUBLE))
|
||||
if (!cv::gpu::TargetArchs::builtWith(cv::gpu::NATIVE_DOUBLE) || !cv::gpu::DeviceInfo().supports(cv::gpu::NATIVE_DOUBLE))
|
||||
CV_Error(CV_StsUnsupportedFormat, "The device doesn't support double");
|
||||
}
|
||||
|
||||
@@ -1406,7 +1402,7 @@ namespace
|
||||
|
||||
#endif // HAVE_CUDA
|
||||
|
||||
void cv::gpu::GpuMat::upload(const Mat& m)
|
||||
void cv::gpu::GpuMat::upload(const cv::Mat& m)
|
||||
{
|
||||
CV_DbgAssert(!m.empty());
|
||||
|
||||
@@ -1415,7 +1411,7 @@ void cv::gpu::GpuMat::upload(const Mat& m)
|
||||
gpuFuncTable()->copy(m, *this);
|
||||
}
|
||||
|
||||
void cv::gpu::GpuMat::download(Mat& m) const
|
||||
void cv::gpu::GpuMat::download(cv::Mat& m) const
|
||||
{
|
||||
CV_DbgAssert(!empty());
|
||||
|
||||
@@ -1424,7 +1420,7 @@ void cv::gpu::GpuMat::download(Mat& m) const
|
||||
gpuFuncTable()->copy(*this, m);
|
||||
}
|
||||
|
||||
void cv::gpu::GpuMat::copyTo(GpuMat& m) const
|
||||
void cv::gpu::GpuMat::copyTo(cv::gpu::GpuMat& m) const
|
||||
{
|
||||
CV_DbgAssert(!empty());
|
||||
|
||||
@@ -1433,7 +1429,7 @@ void cv::gpu::GpuMat::copyTo(GpuMat& m) const
|
||||
gpuFuncTable()->copy(*this, m);
|
||||
}
|
||||
|
||||
void cv::gpu::GpuMat::copyTo(GpuMat& mat, const GpuMat& mask) const
|
||||
void cv::gpu::GpuMat::copyTo(cv::gpu::GpuMat& mat, const cv::gpu::GpuMat& mask) const
|
||||
{
|
||||
if (mask.empty())
|
||||
copyTo(mat);
|
||||
@@ -1445,9 +1441,9 @@ void cv::gpu::GpuMat::copyTo(GpuMat& mat, const GpuMat& mask) const
|
||||
}
|
||||
}
|
||||
|
||||
void cv::gpu::GpuMat::convertTo(GpuMat& dst, int rtype, double alpha, double beta) const
|
||||
void cv::gpu::GpuMat::convertTo(cv::gpu::GpuMat& dst, int rtype, double alpha, double beta) const
|
||||
{
|
||||
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 (rtype < 0)
|
||||
rtype = type();
|
||||
@@ -1462,8 +1458,8 @@ void cv::gpu::GpuMat::convertTo(GpuMat& dst, int rtype, double alpha, double bet
|
||||
return;
|
||||
}
|
||||
|
||||
GpuMat temp;
|
||||
const GpuMat* psrc = this;
|
||||
cv::gpu::GpuMat temp;
|
||||
const cv::gpu::GpuMat* psrc = this;
|
||||
if (sdepth != ddepth && psrc == &dst)
|
||||
{
|
||||
temp = *this;
|
||||
@@ -1478,7 +1474,7 @@ void cv::gpu::GpuMat::convertTo(GpuMat& dst, int rtype, double alpha, double bet
|
||||
gpuFuncTable()->convert(*psrc, dst, alpha, beta);
|
||||
}
|
||||
|
||||
GpuMat& cv::gpu::GpuMat::setTo(Scalar s, const GpuMat& mask)
|
||||
cv::gpu::GpuMat& cv::gpu::GpuMat::setTo(cv::Scalar s, const cv::gpu::GpuMat& mask)
|
||||
{
|
||||
CV_Assert(mask.empty() || mask.type() == CV_8UC1);
|
||||
CV_DbgAssert(!empty());
|
||||
@@ -1502,7 +1498,7 @@ void cv::gpu::GpuMat::create(int _rows, int _cols, int _type)
|
||||
|
||||
if (_rows > 0 && _cols > 0)
|
||||
{
|
||||
flags = Mat::MAGIC_VAL + _type;
|
||||
flags = cv::Mat::MAGIC_VAL + _type;
|
||||
rows = _rows;
|
||||
cols = _cols;
|
||||
|
||||
@@ -1516,7 +1512,7 @@ void cv::gpu::GpuMat::create(int _rows, int _cols, int _type)
|
||||
step = esz * cols;
|
||||
|
||||
if (esz * cols == step)
|
||||
flags |= Mat::CONTINUOUS_FLAG;
|
||||
flags |= cv::Mat::CONTINUOUS_FLAG;
|
||||
|
||||
int64 _nettosize = static_cast<int64>(step) * rows;
|
||||
size_t nettosize = static_cast<size_t>(_nettosize);
|
||||
@@ -1550,13 +1546,13 @@ void cv::gpu::error(const char *error_string, const char *file, const int line,
|
||||
{
|
||||
int code = CV_GpuApiCallError;
|
||||
|
||||
if (uncaught_exception())
|
||||
if (std::uncaught_exception())
|
||||
{
|
||||
const char* errorStr = cvErrorStr(code);
|
||||
const char* function = func ? func : "unknown function";
|
||||
|
||||
cerr << "OpenCV Error: " << errorStr << "(" << error_string << ") in " << function << ", file " << file << ", line " << line;
|
||||
cerr.flush();
|
||||
std::cerr << "OpenCV Error: " << errorStr << "(" << error_string << ") in " << function << ", file " << file << ", line " << line;
|
||||
std::cerr.flush();
|
||||
}
|
||||
else
|
||||
cv::error( cv::Exception(code, error_string, func, file, line) );
|
||||
|
||||
Reference in New Issue
Block a user