1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 15:23:05 +04:00

feat: update NumPy type to Mat type fail message

Output string representation of NumPy array type if it is not
convertible to OpenCV Mat type
This commit is contained in:
Vadim Levin
2023-07-10 18:05:32 +03:00
parent fdc0c12b7f
commit 953de60ff0
3 changed files with 37 additions and 2 deletions
+5 -1
View File
@@ -42,7 +42,7 @@ private:
/**
* Light weight RAII wrapper for `PyObject*` owning references.
* In comparisson to C++11 `std::unique_ptr` with custom deleter, it provides
* In comparison to C++11 `std::unique_ptr` with custom deleter, it provides
* implicit conversion functions that might be useful to initialize it with
* Python functions those returns owning references through the `PyObject**`
* e.g. `PyErr_Fetch` or directly pass it to functions those want to borrow
@@ -70,6 +70,10 @@ public:
return &obj_;
}
operator bool() {
return static_cast<bool>(obj_);
}
PyObject* release()
{
PyObject* obj = obj_;