fixed bugs #2100 (kind of) and #1393

[edit: cleaned whitespace]
This commit is contained in:
Vadim Pisarevsky 2012-10-18 15:29:03 +04:00 committed by Andrey Kamaev
parent 634fedc3cb
commit d652cc72f2

View File

@ -279,11 +279,14 @@ static int pyopencv_to(const PyObject* o, Mat& m, const ArgInfo info, bool allow
needcopy = true; needcopy = true;
} }
if( ismultichannel && _strides[1] != (npy_intp)elemsize*_sizes[2] )
needcopy = true;
if (needcopy) if (needcopy)
{ {
if (info.outputarg) if (info.outputarg)
{ {
failmsg("output array %s is not row-contiguous (step[ndims-1] != elemsize)", info.name); failmsg("Layout of the output array %s is compatible with cv::Mat (step[ndims-1] != elemsize or step[1] != elemsize*nchannels)", info.name);
return false; return false;
} }
if( needcast ) if( needcast )