python: validate high-channel 3D ndarrays on 4.x

This commit is contained in:
NIKHIL
2026-08-13 20:27:50 +05:30
parent 77dfa297d0
commit 726a0959df
2 changed files with 14 additions and 1 deletions

View File

@@ -173,7 +173,7 @@ bool pyopencv_to(PyObject* o, Mat& m, const ArgInfo& info)
CV_LOG_DEBUG(NULL, "Incoming ndarray '" << info.name << "': ndims=" << ndims << " _sizes=" << pycv_dumpArray(_sizes, ndims) << " _strides=" << pycv_dumpArray(_strides, ndims));
bool ismultichannel = ndims == 3 && _sizes[2] <= CV_CN_MAX && !info.nd_mat;
bool ismultichannel = ndims == 3 && !info.nd_mat;
if (pyopencv_Mat_TypePtr && PyObject_TypeCheck(o, pyopencv_Mat_TypePtr))
{
bool wrapChannels = false;