Merge branch '2.4'
This commit is contained in:
@@ -514,7 +514,7 @@ static bool pyopencv_to(PyObject* obj, double& value, const char* name = "<unkno
|
||||
(void)name;
|
||||
if(!obj || obj == Py_None)
|
||||
return true;
|
||||
if(PyInt_CheckExact(obj))
|
||||
if(!!PyInt_CheckExact(obj))
|
||||
value = (double)PyInt_AS_LONG(obj);
|
||||
else
|
||||
value = PyFloat_AsDouble(obj);
|
||||
@@ -531,7 +531,7 @@ static bool pyopencv_to(PyObject* obj, float& value, const char* name = "<unknow
|
||||
(void)name;
|
||||
if(!obj || obj == Py_None)
|
||||
return true;
|
||||
if(PyInt_CheckExact(obj))
|
||||
if(!!PyInt_CheckExact(obj))
|
||||
value = (float)PyInt_AS_LONG(obj);
|
||||
else
|
||||
value = (float)PyFloat_AsDouble(obj);
|
||||
@@ -627,7 +627,7 @@ static inline bool pyopencv_to(PyObject* obj, Point& p, const char* name = "<unk
|
||||
(void)name;
|
||||
if(!obj || obj == Py_None)
|
||||
return true;
|
||||
if(PyComplex_CheckExact(obj))
|
||||
if(!!PyComplex_CheckExact(obj))
|
||||
{
|
||||
Py_complex c = PyComplex_AsCComplex(obj);
|
||||
p.x = saturate_cast<int>(c.real);
|
||||
@@ -642,7 +642,7 @@ static inline bool pyopencv_to(PyObject* obj, Point2f& p, const char* name = "<u
|
||||
(void)name;
|
||||
if(!obj || obj == Py_None)
|
||||
return true;
|
||||
if(PyComplex_CheckExact(obj))
|
||||
if(!!PyComplex_CheckExact(obj))
|
||||
{
|
||||
Py_complex c = PyComplex_AsCComplex(obj);
|
||||
p.x = saturate_cast<float>(c.real);
|
||||
@@ -993,7 +993,7 @@ static bool pyopencv_to(PyObject *o, cv::flann::IndexParams& p, const char *name
|
||||
const char* value = PyString_AsString(item);
|
||||
p.setString(k, value);
|
||||
}
|
||||
else if( PyBool_Check(item) )
|
||||
else if( !!PyBool_Check(item) )
|
||||
p.setBool(k, item == Py_True);
|
||||
else if( PyInt_Check(item) )
|
||||
{
|
||||
|
Reference in New Issue
Block a user