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

added m.empty()

This commit is contained in:
Abhishek Gola
2026-07-22 14:22:40 +05:30
parent ae392712b1
commit 319a03a2c9
+2 -2
View File
@@ -315,9 +315,9 @@ bool pyopencv_to(PyObject* o, Mat& m, const ArgInfo& info)
template<>
PyObject* pyopencv_from(const cv::Mat& m)
{
if( !m.data )
if( m.empty() )
{
// Shaped Mat with a zero-length dim: return a matching empty array, not None.
// empty() also catches a live buffer with a zero-length dim: return an empty array, not None.
if( m.dims >= 1 )
{
int cn = m.channels();