1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 00:03:03 +04:00

Merge pull request #7056 from ludv1x:python-extra-bindings

This commit is contained in:
Maksim Shabunin
2016-08-16 13:00:30 +00:00
8 changed files with 132 additions and 136 deletions
+22
View File
@@ -0,0 +1,22 @@
template<>
bool pyopencv_to(PyObject *obj, CvTermCriteria& dst, const char *name)
{
(void)name;
if(!obj)
return true;
return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.max_iter, &dst.epsilon) > 0;
}
template<>
bool pyopencv_to(PyObject* obj, CvSlice& r, const char* name)
{
(void)name;
if(!obj || obj == Py_None)
return true;
if(PyObject_Size(obj) == 0)
{
r = CV_WHOLE_SEQ;
return true;
}
return PyArg_ParseTuple(obj, "ii", &r.start_index, &r.end_index) > 0;
}