mirror of
https://github.com/opencv/opencv.git
synced 2025-01-23 01:53:13 +08:00
Merge pull request #8500 from Sahloul:fixes/wrappers/ptr
This commit is contained in:
commit
45e866f0e1
@ -1274,14 +1274,16 @@ PyObject* pyopencv_from(const Moments& m)
|
||||
template<typename T>
|
||||
PyObject* pyopencv_from(const cv::Ptr<T>& p)
|
||||
{
|
||||
if (!p) return Py_None;
|
||||
if (!p)
|
||||
Py_RETURN_NONE;
|
||||
return pyopencv_from(*p);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool pyopencv_to(PyObject *o, Ptr<T>& p, const char *name)
|
||||
{
|
||||
if (!o || o == Py_None) return true;
|
||||
if (!o || o == Py_None)
|
||||
return true;
|
||||
p = makePtr<T>();
|
||||
return pyopencv_to(o, *p, name);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user