We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opencv's Mat is restricted to <= 512 channels, but numpy arrays can have any number
>>> a = np.ones((10,10,600),np.uint8) >>> cv2.add(a,a) # no problem ??? >>> cv2.copyMakeBorder(a,3,3,3,3,cv2.BORDER_REFLECT101) Traceback (most recent call last): File "<stdin>", line 1, in <module> cv2.error: OpenCV(4.5.2-pre) C:\p\opencv\modules\core\src\copy.cpp:1026: error: (-215:Assertion failed) top >= 0 && bottom >= 0 && left >= 0 && right >= 0 && _src.dims() <= 2 in function 'copyMakeBorder'
as an unrelated sidenote, cv::Mat will silently wrap around, given more than 512 channels:
cv::Mat m(10,10,CV_8UC(600)); // no exception ! cout << m.channels() << endl; 88
which isn't nice, either.
The text was updated successfully, but these errors were encountered:
With Python use cv.utils.dumpInputArray() to see converted parameter internals.
cv.utils.dumpInputArray()
CV_8UC(...) is a macro. It is caller responsibility to check passed values. There is no problem with cv::Mat itself (as wrong value is passed).
CV_8UC(...)
Sorry, something went wrong.
ah, that's indeed useful (we can see, that the dims() are changing, like the exeption in the 1st post):
>>> a = np.ones((10,10,600),np.uint8) >>> cv2.utils.dumpInputArray(a) 'InputArray: empty()=false kind=0x00010000 flags=0x01010000 total(-1)=60000 dims(-1)=3 size(-1)=[10 10 600] type(-1)=CV_8UC1' >>> b = np.ones((10,10,60),np.uint8) >>> cv2.utils.dumpInputArray(b) 'InputArray: empty()=false kind=0x00010000 flags=0x01010000 total(-1)=100 dims(-1)=2 size(-1)=10x10 type(-1)=CV_8UC60'
No branches or pull requests
Uh oh!
There was an error while loading. Please reload this page.
System information (version)
Detailed description
opencv's Mat is restricted to <= 512 channels, but numpy arrays can have any number
Steps to reproduce
as an unrelated sidenote, cv::Mat will silently wrap around, given more than 512 channels:
which isn't nice, either.
Issue submission checklist
forum.opencv.org, Stack Overflow, etc and have not found solution
The text was updated successfully, but these errors were encountered: