python: properly handle step for multichannel case

This commit is contained in:
Alexander Alekhin
2021-10-29 16:08:57 +00:00
parent 6a2077cbd8
commit 40c748a2ae
3 changed files with 7 additions and 1 deletions
+2
View File
@@ -788,6 +788,8 @@ static bool pyopencv_to(PyObject* o, Mat& m, const ArgInfo& info)
if (ndims >= 1 && _strides[ndims - 1] != (npy_intp)elemsize*_sizes[ndims])
needcopy = true;
elemsize = CV_ELEM_SIZE(type);
}
if (needcopy)