Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin
2018-09-10 00:04:29 +03:00
107 changed files with 492 additions and 485 deletions
+30 -30
View File
@@ -557,7 +557,7 @@ PyObject* pyopencv_from(const cv::Ptr<T>& p)
template<>
bool pyopencv_to(PyObject* obj, void*& ptr, const char* name)
{
(void)name;
CV_UNUSED(name);
if (!obj || obj == Py_None)
return true;
@@ -627,7 +627,7 @@ PyObject* pyopencv_from(const bool& value)
template<>
bool pyopencv_to(PyObject* obj, bool& value, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
int _val = PyObject_IsTrue(obj);
@@ -646,7 +646,7 @@ PyObject* pyopencv_from(const size_t& value)
template<>
bool pyopencv_to(PyObject* obj, size_t& value, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
value = (int)PyLong_AsUnsignedLong(obj);
@@ -662,7 +662,7 @@ PyObject* pyopencv_from(const int& value)
template<>
bool pyopencv_to(PyObject* obj, int& value, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
if(PyInt_Check(obj))
@@ -684,7 +684,7 @@ PyObject* pyopencv_from(const unsigned int& value)
template<>
bool pyopencv_to(PyObject* obj, unsigned int& value, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
if(PyInt_Check(obj))
@@ -706,7 +706,7 @@ PyObject* pyopencv_from(const uchar& value)
template<>
bool pyopencv_to(PyObject* obj, uchar& value, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
int ivalue = (int)PyInt_AsLong(obj);
@@ -723,7 +723,7 @@ PyObject* pyopencv_from(const double& value)
template<>
bool pyopencv_to(PyObject* obj, double& value, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
if(!!PyInt_CheckExact(obj))
@@ -742,7 +742,7 @@ PyObject* pyopencv_from(const float& value)
template<>
bool pyopencv_to(PyObject* obj, float& value, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
if(!!PyInt_CheckExact(obj))
@@ -767,7 +767,7 @@ PyObject* pyopencv_from(const String& value)
template<>
bool pyopencv_to(PyObject* obj, String& value, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
const char* str = PyString_AsString(obj);
@@ -780,7 +780,7 @@ bool pyopencv_to(PyObject* obj, String& value, const char* name)
template<>
bool pyopencv_to(PyObject* obj, Size& sz, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
return PyArg_ParseTuple(obj, "ii", &sz.width, &sz.height) > 0;
@@ -795,7 +795,7 @@ PyObject* pyopencv_from(const Size& sz)
template<>
bool pyopencv_to(PyObject* obj, Size_<float>& sz, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
return PyArg_ParseTuple(obj, "ff", &sz.width, &sz.height) > 0;
@@ -810,7 +810,7 @@ PyObject* pyopencv_from(const Size_<float>& sz)
template<>
bool pyopencv_to(PyObject* obj, Rect& r, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
return PyArg_ParseTuple(obj, "iiii", &r.x, &r.y, &r.width, &r.height) > 0;
@@ -825,7 +825,7 @@ PyObject* pyopencv_from(const Rect& r)
template<>
bool pyopencv_to(PyObject* obj, Rect2d& r, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
return PyArg_ParseTuple(obj, "dddd", &r.x, &r.y, &r.width, &r.height) > 0;
@@ -840,7 +840,7 @@ PyObject* pyopencv_from(const Rect2d& r)
template<>
bool pyopencv_to(PyObject* obj, Range& r, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
if(PyObject_Size(obj) == 0)
@@ -860,7 +860,7 @@ PyObject* pyopencv_from(const Range& r)
template<>
bool pyopencv_to(PyObject* obj, Point& p, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
if(!!PyComplex_CheckExact(obj))
@@ -876,7 +876,7 @@ bool pyopencv_to(PyObject* obj, Point& p, const char* name)
template<>
bool pyopencv_to(PyObject* obj, Point2f& p, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
if(!!PyComplex_CheckExact(obj))
@@ -892,7 +892,7 @@ bool pyopencv_to(PyObject* obj, Point2f& p, const char* name)
template<>
bool pyopencv_to(PyObject* obj, Point2d& p, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
if(!!PyComplex_CheckExact(obj))
@@ -908,7 +908,7 @@ bool pyopencv_to(PyObject* obj, Point2d& p, const char* name)
template<>
bool pyopencv_to(PyObject* obj, Point3f& p, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
return PyArg_ParseTuple(obj, "fff", &p.x, &p.y, &p.z) > 0;
@@ -917,7 +917,7 @@ bool pyopencv_to(PyObject* obj, Point3f& p, const char* name)
template<>
bool pyopencv_to(PyObject* obj, Point3d& p, const char* name)
{
(void)name;
CV_UNUSED(name);
if(!obj || obj == Py_None)
return true;
return PyArg_ParseTuple(obj, "ddd", &p.x, &p.y, &p.z) > 0;
@@ -943,7 +943,7 @@ PyObject* pyopencv_from(const Point3f& p)
static bool pyopencv_to(PyObject* obj, Vec4d& v, ArgInfo info)
{
(void)info;
CV_UNUSED(info);
if (!obj)
return true;
return PyArg_ParseTuple(obj, "dddd", &v[0], &v[1], &v[2], &v[3]) > 0;
@@ -956,7 +956,7 @@ bool pyopencv_to(PyObject* obj, Vec4d& v, const char* name)
static bool pyopencv_to(PyObject* obj, Vec4f& v, ArgInfo info)
{
(void)info;
CV_UNUSED(info);
if (!obj)
return true;
return PyArg_ParseTuple(obj, "ffff", &v[0], &v[1], &v[2], &v[3]) > 0;
@@ -969,7 +969,7 @@ bool pyopencv_to(PyObject* obj, Vec4f& v, const char* name)
static bool pyopencv_to(PyObject* obj, Vec4i& v, ArgInfo info)
{
(void)info;
CV_UNUSED(info);
if (!obj)
return true;
return PyArg_ParseTuple(obj, "iiii", &v[0], &v[1], &v[2], &v[3]) > 0;
@@ -982,7 +982,7 @@ bool pyopencv_to(PyObject* obj, Vec4i& v, const char* name)
static bool pyopencv_to(PyObject* obj, Vec3d& v, ArgInfo info)
{
(void)info;
CV_UNUSED(info);
if (!obj)
return true;
return PyArg_ParseTuple(obj, "ddd", &v[0], &v[1], &v[2]) > 0;
@@ -995,7 +995,7 @@ bool pyopencv_to(PyObject* obj, Vec3d& v, const char* name)
static bool pyopencv_to(PyObject* obj, Vec3f& v, ArgInfo info)
{
(void)info;
CV_UNUSED(info);
if (!obj)
return true;
return PyArg_ParseTuple(obj, "fff", &v[0], &v[1], &v[2]) > 0;
@@ -1008,7 +1008,7 @@ bool pyopencv_to(PyObject* obj, Vec3f& v, const char* name)
static bool pyopencv_to(PyObject* obj, Vec3i& v, ArgInfo info)
{
(void)info;
CV_UNUSED(info);
if (!obj)
return true;
return PyArg_ParseTuple(obj, "iii", &v[0], &v[1], &v[2]) > 0;
@@ -1021,7 +1021,7 @@ bool pyopencv_to(PyObject* obj, Vec3i& v, const char* name)
static bool pyopencv_to(PyObject* obj, Vec2d& v, ArgInfo info)
{
(void)info;
CV_UNUSED(info);
if (!obj)
return true;
return PyArg_ParseTuple(obj, "dd", &v[0], &v[1]) > 0;
@@ -1034,7 +1034,7 @@ bool pyopencv_to(PyObject* obj, Vec2d& v, const char* name)
static bool pyopencv_to(PyObject* obj, Vec2f& v, ArgInfo info)
{
(void)info;
CV_UNUSED(info);
if (!obj)
return true;
return PyArg_ParseTuple(obj, "ff", &v[0], &v[1]) > 0;
@@ -1047,7 +1047,7 @@ bool pyopencv_to(PyObject* obj, Vec2f& v, const char* name)
static bool pyopencv_to(PyObject* obj, Vec2i& v, ArgInfo info)
{
(void)info;
CV_UNUSED(info);
if (!obj)
return true;
return PyArg_ParseTuple(obj, "ii", &v[0], &v[1]) > 0;
@@ -1389,7 +1389,7 @@ template<> struct pyopencvVecConverter<RotatedRect>
template<>
bool pyopencv_to(PyObject *obj, TermCriteria& dst, const char *name)
{
(void)name;
CV_UNUSED(name);
if(!obj)
return true;
return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.maxCount, &dst.epsilon) > 0;
@@ -1404,7 +1404,7 @@ PyObject* pyopencv_from(const TermCriteria& src)
template<>
bool pyopencv_to(PyObject *obj, RotatedRect& dst, const char *name)
{
(void)name;
CV_UNUSED(name);
if(!obj)
return true;
return PyArg_ParseTuple(obj, "(ff)(ff)f", &dst.center.x, &dst.center.y, &dst.size.width, &dst.size.height, &dst.angle) > 0;