1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

completely new C++ persistence implementation (#13011)

* integrated the new C++ persistence; removed old persistence; most of OpenCV compiles fine! the tests have not been run yet

* fixed multiple bugs in the new C++ persistence

* fixed raw size of the parsed empty sequences

* [temporarily] excluded obsolete applications traincascade and createsamples from build

* fixed several compiler warnings and multiple test failures

* undo changes in cocoa window rendering (that was fixed in another PR)

* fixed more compile warnings and the remaining test failures (hopefully)

* trying to fix the last little warning
This commit is contained in:
Vadim Pisarevsky
2018-11-02 00:27:06 +03:00
committed by GitHub
parent ca55982669
commit 0f622206e4
51 changed files with 5662 additions and 8562 deletions
-56
View File
@@ -2118,62 +2118,6 @@ void HOGDescriptor::detectMultiScale(InputArray img, std::vector<Rect>& foundLoc
padding, scale0, finalThreshold, useMeanshiftGrouping);
}
template<typename _ClsName> struct RTTIImpl
{
public:
static int isInstance(const void* ptr)
{
static _ClsName dummy;
static void* dummyp = &dummy;
union
{
const void* p;
const void** pp;
} a, b;
a.p = dummyp;
b.p = ptr;
return *a.pp == *b.pp;
}
static void release(void** dbptr)
{
if(dbptr && *dbptr)
{
delete (_ClsName*)*dbptr;
*dbptr = 0;
}
}
static void* read(CvFileStorage* fs, CvFileNode* n)
{
FileNode fn(fs, n);
_ClsName* obj = new _ClsName;
if(obj->read(fn))
return obj;
delete obj;
return 0;
}
static void write(CvFileStorage* _fs, const char* name, const void* ptr, CvAttrList)
{
if(ptr && _fs)
{
FileStorage fs(_fs, false);
((const _ClsName*)ptr)->write(fs, String(name));
}
}
static void* clone(const void* ptr)
{
if(!ptr)
return 0;
return new _ClsName(*(const _ClsName*)ptr);
}
};
typedef RTTIImpl<HOGDescriptor> HOGRTTI;
CvType hog_type( CV_TYPE_NAME_HOG_DESCRIPTOR, HOGRTTI::isInstance,
HOGRTTI::release, HOGRTTI::read, HOGRTTI::write, HOGRTTI::clone);
std::vector<float> HOGDescriptor::getDefaultPeopleDetector()
{
static const float detector[] = {