2016-08-07 00:46:17 +08:00
|
|
|
template<>
|
2019-11-15 22:29:51 +08:00
|
|
|
bool pyopencv_to(PyObject *obj, CvTermCriteria& dst, const ArgInfo& info)
|
2016-08-07 00:46:17 +08:00
|
|
|
{
|
2019-11-15 22:29:51 +08:00
|
|
|
CV_UNUSED(info);
|
2016-08-07 00:46:17 +08:00
|
|
|
if(!obj)
|
|
|
|
return true;
|
|
|
|
return PyArg_ParseTuple(obj, "iid", &dst.type, &dst.max_iter, &dst.epsilon) > 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
template<>
|
2019-11-15 22:29:51 +08:00
|
|
|
bool pyopencv_to(PyObject* obj, CvSlice& r, const ArgInfo& info)
|
2016-08-07 00:46:17 +08:00
|
|
|
{
|
2019-11-15 22:29:51 +08:00
|
|
|
CV_UNUSED(info);
|
2016-08-07 00:46:17 +08:00
|
|
|
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;
|
|
|
|
}
|