Blame view

3rdparty/opencv-4.5.4/modules/ml/misc/python/pyopencv_ml.hpp 547 Bytes
f4334277   Hu Chunming   提交3rdparty
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  template<>
  bool pyopencv_to(PyObject *obj, CvTermCriteria& dst, const ArgInfo& info)
  {
      CV_UNUSED(info);
      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 ArgInfo& info)
  {
      CV_UNUSED(info);
      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;
  }