Error: OpenCV(4.11.0) 👎 error: (-5:Bad argument) in function 'imshow'

alright… that is puzzling.

I’m unfortunately not in a position to try to repro this on anything close to your system.

that code should have worked flawlessly, on linux, on windows, and on macos. if anything like this were encountered by anyone else, linux having a much greater market share than macos… I think those people would have asked about it on Stack Overflow, but I didn’t see any of that. I strongly doubt this has anything to do with linux. likely it’s a macos/M2 issue.

if this really works on 4.10 but not on 4.11, you should file an issue on opencv’s github (I didn’t see any existing issues that fit). if you open an issue, you should link to this forum thread for context.

if you can try this on a slightly different setup, that’d be great. maybe it’ll fare better on standard python (not anaconda). maybe not. maybe spyder has an effect (try in a plain terminal). maybe not. either way, that’s useful info to have.