All modules (except ocl and gpu) compiles and pass tests
This commit is contained in:
@@ -704,8 +704,8 @@ gpu::VideoWriter_GPU::VideoWriter_GPU
|
||||
Constructors.
|
||||
|
||||
.. ocv:function:: gpu::VideoWriter_GPU::VideoWriter_GPU()
|
||||
.. ocv:function:: gpu::VideoWriter_GPU::VideoWriter_GPU(const std::string& fileName, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR)
|
||||
.. ocv:function:: gpu::VideoWriter_GPU::VideoWriter_GPU(const std::string& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR)
|
||||
.. ocv:function:: gpu::VideoWriter_GPU::VideoWriter_GPU(const cv::String& fileName, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR)
|
||||
.. ocv:function:: gpu::VideoWriter_GPU::VideoWriter_GPU(const cv::String& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR)
|
||||
.. ocv:function:: gpu::VideoWriter_GPU::VideoWriter_GPU(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR)
|
||||
.. ocv:function:: gpu::VideoWriter_GPU::VideoWriter_GPU(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR)
|
||||
|
||||
@@ -729,8 +729,8 @@ gpu::VideoWriter_GPU::open
|
||||
--------------------------
|
||||
Initializes or reinitializes video writer.
|
||||
|
||||
.. ocv:function:: void gpu::VideoWriter_GPU::open(const std::string& fileName, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR)
|
||||
.. ocv:function:: void gpu::VideoWriter_GPU::open(const std::string& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR)
|
||||
.. ocv:function:: void gpu::VideoWriter_GPU::open(const cv::String& fileName, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR)
|
||||
.. ocv:function:: void gpu::VideoWriter_GPU::open(const cv::String& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR)
|
||||
.. ocv:function:: void gpu::VideoWriter_GPU::open(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR)
|
||||
.. ocv:function:: void gpu::VideoWriter_GPU::open(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR)
|
||||
|
||||
@@ -797,10 +797,10 @@ Different parameters for CUDA video encoder. ::
|
||||
int DisableSPSPPS; // NVVE_DISABLE_SPS_PPS
|
||||
|
||||
EncoderParams();
|
||||
explicit EncoderParams(const std::string& configFile);
|
||||
explicit EncoderParams(const cv::String& configFile);
|
||||
|
||||
void load(const std::string& configFile);
|
||||
void save(const std::string& configFile) const;
|
||||
void load(const cv::String& configFile);
|
||||
void save(const cv::String& configFile) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -810,7 +810,7 @@ gpu::VideoWriter_GPU::EncoderParams::EncoderParams
|
||||
Constructors.
|
||||
|
||||
.. ocv:function:: gpu::VideoWriter_GPU::EncoderParams::EncoderParams()
|
||||
.. ocv:function:: gpu::VideoWriter_GPU::EncoderParams::EncoderParams(const std::string& configFile)
|
||||
.. ocv:function:: gpu::VideoWriter_GPU::EncoderParams::EncoderParams(const cv::String& configFile)
|
||||
|
||||
:param configFile: Config file name.
|
||||
|
||||
@@ -822,7 +822,7 @@ gpu::VideoWriter_GPU::EncoderParams::load
|
||||
-----------------------------------------
|
||||
Reads parameters from config file.
|
||||
|
||||
.. ocv:function:: void gpu::VideoWriter_GPU::EncoderParams::load(const std::string& configFile)
|
||||
.. ocv:function:: void gpu::VideoWriter_GPU::EncoderParams::load(const cv::String& configFile)
|
||||
|
||||
:param configFile: Config file name.
|
||||
|
||||
@@ -832,7 +832,7 @@ gpu::VideoWriter_GPU::EncoderParams::save
|
||||
-----------------------------------------
|
||||
Saves parameters to config file.
|
||||
|
||||
.. ocv:function:: void gpu::VideoWriter_GPU::EncoderParams::save(const std::string& configFile) const
|
||||
.. ocv:function:: void gpu::VideoWriter_GPU::EncoderParams::save(const cv::String& configFile) const
|
||||
|
||||
:param configFile: Config file name.
|
||||
|
||||
@@ -982,7 +982,7 @@ gpu::VideoReader_GPU::VideoReader_GPU
|
||||
Constructors.
|
||||
|
||||
.. ocv:function:: gpu::VideoReader_GPU::VideoReader_GPU()
|
||||
.. ocv:function:: gpu::VideoReader_GPU::VideoReader_GPU(const std::string& filename)
|
||||
.. ocv:function:: gpu::VideoReader_GPU::VideoReader_GPU(const cv::String& filename)
|
||||
.. ocv:function:: gpu::VideoReader_GPU::VideoReader_GPU(const cv::Ptr<VideoSource>& source)
|
||||
|
||||
:param filename: Name of the input video file.
|
||||
@@ -997,7 +997,7 @@ gpu::VideoReader_GPU::open
|
||||
--------------------------
|
||||
Initializes or reinitializes video reader.
|
||||
|
||||
.. ocv:function:: void gpu::VideoReader_GPU::open(const std::string& filename)
|
||||
.. ocv:function:: void gpu::VideoReader_GPU::open(const cv::String& filename)
|
||||
.. ocv:function:: void gpu::VideoReader_GPU::open(const cv::Ptr<VideoSource>& source)
|
||||
|
||||
The method opens video reader. Parameters are the same as in the constructor :ocv:func:`gpu::VideoReader_GPU::VideoReader_GPU` . The method throws :ocv:class:`Exception` if error occurs.
|
||||
|
@@ -1384,11 +1384,11 @@ class CV_EXPORTS CascadeClassifier_GPU
|
||||
{
|
||||
public:
|
||||
CascadeClassifier_GPU();
|
||||
CascadeClassifier_GPU(const std::string& filename);
|
||||
CascadeClassifier_GPU(const cv::String& filename);
|
||||
~CascadeClassifier_GPU();
|
||||
|
||||
bool empty() const;
|
||||
bool load(const std::string& filename);
|
||||
bool load(const cv::String& filename);
|
||||
void release();
|
||||
|
||||
/* returns number of detected objects */
|
||||
@@ -2170,15 +2170,15 @@ public:
|
||||
};
|
||||
|
||||
VideoWriter_GPU();
|
||||
VideoWriter_GPU(const std::string& fileName, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR);
|
||||
VideoWriter_GPU(const std::string& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR);
|
||||
VideoWriter_GPU(const cv::String& fileName, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR);
|
||||
VideoWriter_GPU(const cv::String& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR);
|
||||
VideoWriter_GPU(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR);
|
||||
VideoWriter_GPU(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR);
|
||||
~VideoWriter_GPU();
|
||||
|
||||
// all methods throws cv::Exception if error occurs
|
||||
void open(const std::string& fileName, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR);
|
||||
void open(const std::string& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR);
|
||||
void open(const cv::String& fileName, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR);
|
||||
void open(const cv::String& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR);
|
||||
void open(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, SurfaceFormat format = SF_BGR);
|
||||
void open(const cv::Ptr<EncoderCallBack>& encoderCallback, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format = SF_BGR);
|
||||
|
||||
@@ -2210,10 +2210,10 @@ public:
|
||||
int DisableSPSPPS; // NVVE_DISABLE_SPS_PPS
|
||||
|
||||
EncoderParams();
|
||||
explicit EncoderParams(const std::string& configFile);
|
||||
explicit EncoderParams(const cv::String& configFile);
|
||||
|
||||
void load(const std::string& configFile);
|
||||
void save(const std::string& configFile) const;
|
||||
void load(const cv::String& configFile);
|
||||
void save(const cv::String& configFile) const;
|
||||
};
|
||||
|
||||
EncoderParams getParams() const;
|
||||
@@ -2301,12 +2301,12 @@ public:
|
||||
class VideoSource;
|
||||
|
||||
VideoReader_GPU();
|
||||
explicit VideoReader_GPU(const std::string& filename);
|
||||
explicit VideoReader_GPU(const cv::String& filename);
|
||||
explicit VideoReader_GPU(const cv::Ptr<VideoSource>& source);
|
||||
|
||||
~VideoReader_GPU();
|
||||
|
||||
void open(const std::string& filename);
|
||||
void open(const cv::String& filename);
|
||||
void open(const cv::Ptr<VideoSource>& source);
|
||||
bool isOpened() const;
|
||||
|
||||
|
@@ -50,10 +50,10 @@ using namespace cv::gpu;
|
||||
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
|
||||
|
||||
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU() { throw_nogpu(); }
|
||||
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const std::string&) { throw_nogpu(); }
|
||||
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const cv::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 std::string&) { throw_nogpu(); return true; }
|
||||
bool cv::gpu::CascadeClassifier_GPU::load(const cv::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;}
|
||||
@@ -71,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 std::string& classifierAsXml) = 0;
|
||||
virtual bool read(const cv::String& classifierAsXml) = 0;
|
||||
};
|
||||
|
||||
struct cv::gpu::CascadeClassifier_GPU::HaarCascade : cv::gpu::CascadeClassifier_GPU::CascadeClassifierImpl
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
ncvSetDebugOutputHandler(NCVDebugOutputHandler);
|
||||
}
|
||||
|
||||
bool read(const std::string& filename)
|
||||
bool read(const cv::String& filename)
|
||||
{
|
||||
ncvSafeCall( load(filename) );
|
||||
return true;
|
||||
@@ -169,9 +169,9 @@ public:
|
||||
cv::Size getClassifierCvSize() const { return cv::Size(haar.ClassifierSize.width, haar.ClassifierSize.height); }
|
||||
|
||||
private:
|
||||
static void NCVDebugOutputHandler(const std::string &msg) { CV_Error(CV_GpuApiCallError, msg.c_str()); }
|
||||
static void NCVDebugOutputHandler(const cv::String &msg) { CV_Error(CV_GpuApiCallError, msg.c_str()); }
|
||||
|
||||
NCVStatus load(const std::string& classifierFile)
|
||||
NCVStatus load(const cv::String& classifierFile)
|
||||
{
|
||||
int devId = cv::gpu::getDevice();
|
||||
ncvAssertCUDAReturn(cudaGetDeviceProperties(&devProp, devId), NCV_CUDA_ERROR);
|
||||
@@ -458,7 +458,7 @@ public:
|
||||
|
||||
virtual cv::Size getClassifierCvSize() const { return NxM; }
|
||||
|
||||
bool read(const std::string& classifierAsXml)
|
||||
bool read(const cv::String& classifierAsXml)
|
||||
{
|
||||
FileStorage fs(classifierAsXml, FileStorage::READ);
|
||||
return fs.isOpened() ? read(fs.getFirstTopLevelNode()) : false;
|
||||
@@ -512,10 +512,10 @@ private:
|
||||
const char *GPU_CC_FEATURES = "features";
|
||||
const char *GPU_CC_RECT = "rect";
|
||||
|
||||
std::string stageTypeStr = (std::string)root[GPU_CC_STAGE_TYPE];
|
||||
cv::String stageTypeStr = (cv::String)root[GPU_CC_STAGE_TYPE];
|
||||
CV_Assert(stageTypeStr == GPU_CC_BOOST);
|
||||
|
||||
std::string featureTypeStr = (std::string)root[GPU_CC_FEATURE_TYPE];
|
||||
cv::String featureTypeStr = (cv::String)root[GPU_CC_FEATURE_TYPE];
|
||||
CV_Assert(featureTypeStr == GPU_CC_LBP);
|
||||
|
||||
NxM.width = (int)root[GPU_CC_WIDTH];
|
||||
@@ -662,7 +662,7 @@ private:
|
||||
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU()
|
||||
: findLargestObject(false), visualizeInPlace(false), impl(0) {}
|
||||
|
||||
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const std::string& filename)
|
||||
cv::gpu::CascadeClassifier_GPU::CascadeClassifier_GPU(const cv::String& filename)
|
||||
: findLargestObject(false), visualizeInPlace(false), impl(0) { load(filename); }
|
||||
|
||||
cv::gpu::CascadeClassifier_GPU::~CascadeClassifier_GPU() { release(); }
|
||||
@@ -688,11 +688,11 @@ 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 std::string& filename)
|
||||
bool cv::gpu::CascadeClassifier_GPU::load(const cv::String& filename)
|
||||
{
|
||||
release();
|
||||
|
||||
std::string fext = filename.substr(filename.find_last_of(".") + 1);
|
||||
cv::String fext = filename.substr(filename.find_last_of(".") + 1);
|
||||
std::transform(fext.begin(), fext.end(), fext.begin(), ::tolower);
|
||||
|
||||
if (fext == "nvbin")
|
||||
@@ -710,7 +710,7 @@ bool cv::gpu::CascadeClassifier_GPU::load(const std::string& filename)
|
||||
}
|
||||
|
||||
const char *GPU_CC_LBP = "LBP";
|
||||
std::string featureTypeStr = (std::string)fs.getFirstTopLevelNode()["featureType"];
|
||||
cv::String featureTypeStr = (cv::String)fs.getFirstTopLevelNode()["featureType"];
|
||||
if (featureTypeStr == GPU_CC_LBP)
|
||||
impl = new LbpCascade();
|
||||
else
|
||||
@@ -759,7 +759,7 @@ void groupRectangles(std::vector<NcvRect32u> &hypotheses, int groupThreshold, do
|
||||
hypotheses.resize(rects.size());
|
||||
}
|
||||
|
||||
NCVStatus loadFromXML(const std::string &filename,
|
||||
NCVStatus loadFromXML(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor &haar,
|
||||
std::vector<HaarStage64> &haarStages,
|
||||
std::vector<HaarClassifierNode128> &haarClassifierNodes,
|
||||
|
@@ -51,7 +51,7 @@ namespace
|
||||
struct ErrorEntry
|
||||
{
|
||||
int code;
|
||||
std::string str;
|
||||
cv::String str;
|
||||
};
|
||||
|
||||
class ErrorEntryComparer
|
||||
@@ -65,11 +65,11 @@ namespace
|
||||
int code_;
|
||||
};
|
||||
|
||||
std::string getErrorString(int code, const ErrorEntry* errors, size_t n)
|
||||
cv::String getErrorString(int code, const ErrorEntry* errors, size_t n)
|
||||
{
|
||||
size_t idx = std::find_if(errors, errors + n, ErrorEntryComparer(code)) - errors;
|
||||
|
||||
const std::string& msg = (idx != n) ? errors[idx].str : std::string("Unknown error code");
|
||||
const cv::String& msg = (idx != n) ? errors[idx].str : cv::String("Unknown error code");
|
||||
|
||||
std::ostringstream ostr;
|
||||
ostr << msg << " [Code = " << code << "]";
|
||||
@@ -131,7 +131,7 @@ namespace
|
||||
const size_t cu_errors_num = sizeof(cu_errors) / sizeof(cu_errors[0]);
|
||||
}
|
||||
|
||||
std::string cv::gpu::detail::cuGetErrString(CUresult res)
|
||||
cv::String cv::gpu::detail::cuGetErrString(CUresult res)
|
||||
{
|
||||
return getErrorString(res, cu_errors, cu_errors_num);
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@
|
||||
namespace cv { namespace gpu {
|
||||
namespace detail
|
||||
{
|
||||
std::string cuGetErrString(CUresult res);
|
||||
cv::String cuGetErrString(CUresult res);
|
||||
|
||||
inline void cuSafeCall_impl(CUresult res, const char* file, int line)
|
||||
{
|
||||
|
@@ -3,7 +3,7 @@
|
||||
|
||||
#if defined(HAVE_CUDA) && defined(HAVE_NVCUVID)
|
||||
|
||||
cv::gpu::detail::CuvidVideoSource::CuvidVideoSource(const std::string& fname)
|
||||
cv::gpu::detail::CuvidVideoSource::CuvidVideoSource(const cv::String& fname)
|
||||
{
|
||||
CUVIDSOURCEPARAMS params;
|
||||
std::memset(¶ms, 0, sizeof(CUVIDSOURCEPARAMS));
|
||||
|
@@ -54,7 +54,7 @@ namespace cv { namespace gpu
|
||||
class CuvidVideoSource : public VideoReader_GPU::VideoSource
|
||||
{
|
||||
public:
|
||||
explicit CuvidVideoSource(const std::string& fname);
|
||||
explicit CuvidVideoSource(const cv::String& fname);
|
||||
~CuvidVideoSource() { cuvidDestroyVideoSource(videoSource_); }
|
||||
|
||||
VideoReader_GPU::FormatInfo format() const;
|
||||
|
@@ -54,7 +54,7 @@ namespace
|
||||
struct ErrorEntry
|
||||
{
|
||||
int code;
|
||||
std::string str;
|
||||
cv::String str;
|
||||
};
|
||||
|
||||
struct ErrorEntryComparer
|
||||
@@ -64,11 +64,11 @@ namespace
|
||||
bool operator()(const ErrorEntry& e) const { return e.code == code; }
|
||||
};
|
||||
|
||||
std::string getErrorString(int code, const ErrorEntry* errors, size_t n)
|
||||
cv::String getErrorString(int code, const ErrorEntry* errors, size_t n)
|
||||
{
|
||||
size_t idx = std::find_if(errors, errors + n, ErrorEntryComparer(code)) - errors;
|
||||
|
||||
const std::string& msg = (idx != n) ? errors[idx].str : std::string("Unknown error code");
|
||||
const cv::String& msg = (idx != n) ? errors[idx].str : cv::String("Unknown error code");
|
||||
|
||||
std::ostringstream ostr;
|
||||
ostr << msg << " [Code = " << code << "]";
|
||||
@@ -221,25 +221,25 @@ namespace cv
|
||||
{
|
||||
void nppError(int code, const char *file, const int line, const char *func)
|
||||
{
|
||||
std::string msg = getErrorString(code, npp_errors, npp_error_num);
|
||||
cv::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)
|
||||
{
|
||||
std::string msg = getErrorString(code, ncv_errors, ncv_error_num);
|
||||
cv::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)
|
||||
{
|
||||
std::string msg = getErrorString(code, cufft_errors, cufft_error_num);
|
||||
cv::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)
|
||||
{
|
||||
std::string msg = getErrorString(code, cublas_errors, cublas_error_num);
|
||||
cv::String msg = getErrorString(code, cublas_errors, cublas_error_num);
|
||||
cv::gpu::error(msg.c_str(), file, line, func);
|
||||
}
|
||||
}
|
||||
|
@@ -96,7 +96,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
cv::gpu::detail::FFmpegVideoSource::FFmpegVideoSource(const std::string& fname) :
|
||||
cv::gpu::detail::FFmpegVideoSource::FFmpegVideoSource(const cv::String& fname) :
|
||||
stream_(0)
|
||||
{
|
||||
CV_Assert( init_MediaStream_FFMPEG() );
|
||||
|
@@ -57,7 +57,7 @@ namespace cv { namespace gpu
|
||||
class FFmpegVideoSource : public VideoReader_GPU::VideoSource
|
||||
{
|
||||
public:
|
||||
FFmpegVideoSource(const std::string& fname);
|
||||
FFmpegVideoSource(const cv::String& fname);
|
||||
~FFmpegVideoSource();
|
||||
|
||||
VideoReader_GPU::FormatInfo format() const;
|
||||
|
@@ -2099,7 +2099,7 @@ NCVStatus ncvGrowDetectionsVector_host(NCVVector<Ncv32u> &pixelMask,
|
||||
}
|
||||
|
||||
|
||||
NCVStatus loadFromXML(const std::string &filename,
|
||||
NCVStatus loadFromXML(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor &haar,
|
||||
std::vector<HaarStage64> &haarStages,
|
||||
std::vector<HaarClassifierNode128> &haarClassifierNodes,
|
||||
@@ -2110,7 +2110,7 @@ NCVStatus loadFromXML(const std::string &filename,
|
||||
#define NVBIN_HAAR_VERSION 0x1
|
||||
|
||||
|
||||
static NCVStatus loadFromNVBIN(const std::string &filename,
|
||||
static NCVStatus loadFromNVBIN(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor &haar,
|
||||
std::vector<HaarStage64> &haarStages,
|
||||
std::vector<HaarClassifierNode128> &haarClassifierNodes,
|
||||
@@ -2174,13 +2174,13 @@ static NCVStatus loadFromNVBIN(const std::string &filename,
|
||||
}
|
||||
|
||||
|
||||
NCVStatus ncvHaarGetClassifierSize(const std::string &filename, Ncv32u &numStages,
|
||||
NCVStatus ncvHaarGetClassifierSize(const cv::String &filename, Ncv32u &numStages,
|
||||
Ncv32u &numNodes, Ncv32u &numFeatures)
|
||||
{
|
||||
size_t readCount;
|
||||
NCVStatus ncvStat;
|
||||
|
||||
std::string fext = filename.substr(filename.find_last_of(".") + 1);
|
||||
cv::String fext = filename.substr(filename.find_last_of(".") + 1);
|
||||
std::transform(fext.begin(), fext.end(), fext.begin(), ::tolower);
|
||||
|
||||
if (fext == "nvbin")
|
||||
@@ -2226,7 +2226,7 @@ NCVStatus ncvHaarGetClassifierSize(const std::string &filename, Ncv32u &numStage
|
||||
}
|
||||
|
||||
|
||||
NCVStatus ncvHaarLoadFromFile_host(const std::string &filename,
|
||||
NCVStatus ncvHaarLoadFromFile_host(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor &haar,
|
||||
NCVVector<HaarStage64> &h_HaarStages,
|
||||
NCVVector<HaarClassifierNode128> &h_HaarNodes,
|
||||
@@ -2238,7 +2238,7 @@ NCVStatus ncvHaarLoadFromFile_host(const std::string &filename,
|
||||
|
||||
NCVStatus ncvStat;
|
||||
|
||||
std::string fext = filename.substr(filename.find_last_of(".") + 1);
|
||||
cv::String fext = filename.substr(filename.find_last_of(".") + 1);
|
||||
std::transform(fext.begin(), fext.end(), fext.begin(), ::tolower);
|
||||
|
||||
std::vector<HaarStage64> haarStages;
|
||||
@@ -2272,7 +2272,7 @@ NCVStatus ncvHaarLoadFromFile_host(const std::string &filename,
|
||||
}
|
||||
|
||||
|
||||
NCVStatus ncvHaarStoreNVBIN_host(const std::string &filename,
|
||||
NCVStatus ncvHaarStoreNVBIN_host(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor haar,
|
||||
NCVVector<HaarStage64> &h_HaarStages,
|
||||
NCVVector<HaarClassifierNode128> &h_HaarNodes,
|
||||
|
@@ -439,18 +439,18 @@ NCV_EXPORTS NCVStatus ncvGrowDetectionsVector_host(NCVVector<Ncv32u> &pixelMask,
|
||||
Ncv32f curScale);
|
||||
|
||||
|
||||
NCV_EXPORTS NCVStatus ncvHaarGetClassifierSize(const std::string &filename, Ncv32u &numStages,
|
||||
NCV_EXPORTS NCVStatus ncvHaarGetClassifierSize(const cv::String &filename, Ncv32u &numStages,
|
||||
Ncv32u &numNodes, Ncv32u &numFeatures);
|
||||
|
||||
|
||||
NCV_EXPORTS NCVStatus ncvHaarLoadFromFile_host(const std::string &filename,
|
||||
NCV_EXPORTS NCVStatus ncvHaarLoadFromFile_host(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor &haar,
|
||||
NCVVector<HaarStage64> &h_HaarStages,
|
||||
NCVVector<HaarClassifierNode128> &h_HaarNodes,
|
||||
NCVVector<HaarFeature64> &h_HaarFeatures);
|
||||
|
||||
|
||||
NCV_EXPORTS NCVStatus ncvHaarStoreNVBIN_host(const std::string &filename,
|
||||
NCV_EXPORTS NCVStatus ncvHaarStoreNVBIN_host(const cv::String &filename,
|
||||
HaarClassifierCascadeDescriptor haar,
|
||||
NCVVector<HaarStage64> &h_HaarStages,
|
||||
NCVVector<HaarClassifierNode128> &h_HaarNodes,
|
||||
|
@@ -53,7 +53,7 @@
|
||||
//==============================================================================
|
||||
|
||||
|
||||
static void stdDebugOutput(const std::string &msg)
|
||||
static void stdDebugOutput(const cv::String &msg)
|
||||
{
|
||||
std::cout << msg;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ static void stdDebugOutput(const std::string &msg)
|
||||
static NCVDebugOutputHandler *debugOutputHandler = stdDebugOutput;
|
||||
|
||||
|
||||
void ncvDebugOutput(const std::string &msg)
|
||||
void ncvDebugOutput(const cv::String &msg)
|
||||
{
|
||||
debugOutputHandler(msg);
|
||||
}
|
||||
|
@@ -243,10 +243,10 @@ const Ncv32u K_LOG2_WARP_SIZE = 5;
|
||||
//==============================================================================
|
||||
|
||||
|
||||
NCV_EXPORTS void ncvDebugOutput(const std::string &msg);
|
||||
NCV_EXPORTS void ncvDebugOutput(const cv::String &msg);
|
||||
|
||||
|
||||
typedef void NCVDebugOutputHandler(const std::string &msg);
|
||||
typedef void NCVDebugOutputHandler(const cv::String &msg);
|
||||
|
||||
|
||||
NCV_EXPORTS void ncvSetDebugOutputHandler(NCVDebugOutputHandler* func);
|
||||
|
@@ -68,7 +68,7 @@ namespace
|
||||
|
||||
namespace
|
||||
{
|
||||
static void outputHandler(const std::string &msg) { CV_Error(CV_GpuApiCallError, msg.c_str()); }
|
||||
static void outputHandler(const cv::String &msg) { CV_Error(CV_GpuApiCallError, msg.c_str()); }
|
||||
}
|
||||
|
||||
void cv::gpu::BroxOpticalFlow::operator ()(const GpuMat& frame0, const GpuMat& frame1, GpuMat& u, GpuMat& v, Stream& s)
|
||||
|
@@ -49,10 +49,10 @@ class cv::gpu::VideoReader_GPU::Impl
|
||||
};
|
||||
|
||||
cv::gpu::VideoReader_GPU::VideoReader_GPU() { throw_nogpu(); }
|
||||
cv::gpu::VideoReader_GPU::VideoReader_GPU(const std::string&) { throw_nogpu(); }
|
||||
cv::gpu::VideoReader_GPU::VideoReader_GPU(const cv::String&) { throw_nogpu(); }
|
||||
cv::gpu::VideoReader_GPU::VideoReader_GPU(const cv::Ptr<VideoSource>&) { throw_nogpu(); }
|
||||
cv::gpu::VideoReader_GPU::~VideoReader_GPU() { }
|
||||
void cv::gpu::VideoReader_GPU::open(const std::string&) { throw_nogpu(); }
|
||||
void cv::gpu::VideoReader_GPU::open(const cv::String&) { throw_nogpu(); }
|
||||
void cv::gpu::VideoReader_GPU::open(const cv::Ptr<VideoSource>&) { throw_nogpu(); }
|
||||
bool cv::gpu::VideoReader_GPU::isOpened() const { return false; }
|
||||
void cv::gpu::VideoReader_GPU::close() { }
|
||||
@@ -294,7 +294,7 @@ cv::gpu::VideoReader_GPU::VideoReader_GPU()
|
||||
{
|
||||
}
|
||||
|
||||
cv::gpu::VideoReader_GPU::VideoReader_GPU(const std::string& filename)
|
||||
cv::gpu::VideoReader_GPU::VideoReader_GPU(const cv::String& filename)
|
||||
{
|
||||
open(filename);
|
||||
}
|
||||
@@ -309,7 +309,7 @@ cv::gpu::VideoReader_GPU::~VideoReader_GPU()
|
||||
close();
|
||||
}
|
||||
|
||||
void cv::gpu::VideoReader_GPU::open(const std::string& filename)
|
||||
void cv::gpu::VideoReader_GPU::open(const cv::String& filename)
|
||||
{
|
||||
CV_Assert( !filename.empty() );
|
||||
|
||||
|
@@ -49,13 +49,13 @@ class cv::gpu::VideoWriter_GPU::Impl
|
||||
};
|
||||
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU() { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU(const std::string&, cv::Size, double, SurfaceFormat) { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU(const std::string&, cv::Size, double, const EncoderParams&, SurfaceFormat) { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU(const cv::String&, cv::Size, double, SurfaceFormat) { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU(const cv::String&, cv::Size, double, const EncoderParams&, SurfaceFormat) { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU(const cv::Ptr<EncoderCallBack>&, cv::Size, double, SurfaceFormat) { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU(const cv::Ptr<EncoderCallBack>&, cv::Size, double, const EncoderParams&, SurfaceFormat) { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::~VideoWriter_GPU() {}
|
||||
void cv::gpu::VideoWriter_GPU::open(const std::string&, cv::Size, double, SurfaceFormat) { throw_nogpu(); }
|
||||
void cv::gpu::VideoWriter_GPU::open(const std::string&, cv::Size, double, const EncoderParams&, SurfaceFormat) { throw_nogpu(); }
|
||||
void cv::gpu::VideoWriter_GPU::open(const cv::String&, cv::Size, double, SurfaceFormat) { throw_nogpu(); }
|
||||
void cv::gpu::VideoWriter_GPU::open(const cv::String&, cv::Size, double, const EncoderParams&, SurfaceFormat) { throw_nogpu(); }
|
||||
void cv::gpu::VideoWriter_GPU::open(const cv::Ptr<EncoderCallBack>&, cv::Size, double, SurfaceFormat) { throw_nogpu(); }
|
||||
void cv::gpu::VideoWriter_GPU::open(const cv::Ptr<EncoderCallBack>&, cv::Size, double, const EncoderParams&, SurfaceFormat) { throw_nogpu(); }
|
||||
bool cv::gpu::VideoWriter_GPU::isOpened() const { return false; }
|
||||
@@ -64,9 +64,9 @@ void cv::gpu::VideoWriter_GPU::write(const cv::gpu::GpuMat&, bool) { throw_nogpu
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams cv::gpu::VideoWriter_GPU::getParams() const { EncoderParams params; throw_nogpu(); return params; }
|
||||
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams::EncoderParams() { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams::EncoderParams(const std::string&) { throw_nogpu(); }
|
||||
void cv::gpu::VideoWriter_GPU::EncoderParams::load(const std::string&) { throw_nogpu(); }
|
||||
void cv::gpu::VideoWriter_GPU::EncoderParams::save(const std::string&) const { throw_nogpu(); }
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams::EncoderParams(const cv::String&) { throw_nogpu(); }
|
||||
void cv::gpu::VideoWriter_GPU::EncoderParams::load(const cv::String&) { throw_nogpu(); }
|
||||
void cv::gpu::VideoWriter_GPU::EncoderParams::save(const cv::String&) const { throw_nogpu(); }
|
||||
|
||||
#else // !defined HAVE_CUDA || !defined WIN32
|
||||
|
||||
@@ -736,7 +736,7 @@ void NVENCAPI cv::gpu::VideoWriter_GPU::Impl::HandleOnEndFrame(const NVVE_EndFra
|
||||
class EncoderCallBackFFMPEG : public cv::gpu::VideoWriter_GPU::EncoderCallBack
|
||||
{
|
||||
public:
|
||||
EncoderCallBackFFMPEG(const std::string& fileName, cv::Size frameSize, double fps);
|
||||
EncoderCallBackFFMPEG(const cv::String& fileName, cv::Size frameSize, double fps);
|
||||
~EncoderCallBackFFMPEG();
|
||||
|
||||
unsigned char* acquireBitStream(int* bufferSize);
|
||||
@@ -799,7 +799,7 @@ namespace
|
||||
}
|
||||
}
|
||||
|
||||
EncoderCallBackFFMPEG::EncoderCallBackFFMPEG(const std::string& fileName, cv::Size frameSize, double fps) :
|
||||
EncoderCallBackFFMPEG::EncoderCallBackFFMPEG(const cv::String& fileName, cv::Size frameSize, double fps) :
|
||||
stream_(0), isKeyFrame_(false)
|
||||
{
|
||||
int buf_size = std::max(frameSize.area() * 4, 1024 * 1024);
|
||||
@@ -843,12 +843,12 @@ cv::gpu::VideoWriter_GPU::VideoWriter_GPU()
|
||||
{
|
||||
}
|
||||
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU(const std::string& fileName, cv::Size frameSize, double fps, SurfaceFormat format)
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU(const cv::String& fileName, cv::Size frameSize, double fps, SurfaceFormat format)
|
||||
{
|
||||
open(fileName, frameSize, fps, format);
|
||||
}
|
||||
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU(const std::string& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format)
|
||||
cv::gpu::VideoWriter_GPU::VideoWriter_GPU(const cv::String& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format)
|
||||
{
|
||||
open(fileName, frameSize, fps, params, format);
|
||||
}
|
||||
@@ -868,14 +868,14 @@ cv::gpu::VideoWriter_GPU::~VideoWriter_GPU()
|
||||
close();
|
||||
}
|
||||
|
||||
void cv::gpu::VideoWriter_GPU::open(const std::string& fileName, cv::Size frameSize, double fps, SurfaceFormat format)
|
||||
void cv::gpu::VideoWriter_GPU::open(const cv::String& fileName, cv::Size frameSize, double fps, SurfaceFormat format)
|
||||
{
|
||||
close();
|
||||
cv::Ptr<EncoderCallBack> encoderCallback(new EncoderCallBackFFMPEG(fileName, frameSize, fps));
|
||||
open(encoderCallback, frameSize, fps, format);
|
||||
}
|
||||
|
||||
void cv::gpu::VideoWriter_GPU::open(const std::string& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format)
|
||||
void cv::gpu::VideoWriter_GPU::open(const cv::String& fileName, cv::Size frameSize, double fps, const EncoderParams& params, SurfaceFormat format)
|
||||
{
|
||||
close();
|
||||
cv::Ptr<EncoderCallBack> encoderCallback(new EncoderCallBackFFMPEG(fileName, frameSize, fps));
|
||||
@@ -944,12 +944,12 @@ cv::gpu::VideoWriter_GPU::EncoderParams::EncoderParams()
|
||||
DisableSPSPPS = 0;
|
||||
}
|
||||
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams::EncoderParams(const std::string& configFile)
|
||||
cv::gpu::VideoWriter_GPU::EncoderParams::EncoderParams(const cv::String& configFile)
|
||||
{
|
||||
load(configFile);
|
||||
}
|
||||
|
||||
void cv::gpu::VideoWriter_GPU::EncoderParams::load(const std::string& configFile)
|
||||
void cv::gpu::VideoWriter_GPU::EncoderParams::load(const cv::String& configFile)
|
||||
{
|
||||
cv::FileStorage fs(configFile, cv::FileStorage::READ);
|
||||
CV_Assert( fs.isOpened() );
|
||||
@@ -975,7 +975,7 @@ void cv::gpu::VideoWriter_GPU::EncoderParams::load(const std::string& configFile
|
||||
cv::read(fs["DisableSPSPPS" ], DisableSPSPPS, 0);
|
||||
}
|
||||
|
||||
void cv::gpu::VideoWriter_GPU::EncoderParams::save(const std::string& configFile) const
|
||||
void cv::gpu::VideoWriter_GPU::EncoderParams::save(const cv::String& configFile) const
|
||||
{
|
||||
cv::FileStorage fs(configFile, cv::FileStorage::WRITE);
|
||||
CV_Assert( fs.isOpened() );
|
||||
|
Reference in New Issue
Block a user