DJITelloPy icon indicating copy to clipboard operation
DJITelloPy copied to clipboard

cv2.error: Unknown C++ exception from OpenCV code

Open DiegoDG-01 opened this issue 1 year ago • 1 comments

Hello 👋🏼

I'm have a problem, my terminal shows the following message on the screen when I try the drone camera on the screen

cv2.imshow("Drone Camera", frame)
cv2.error: Unknown C++ exception from OpenCV code
Assertion failed: (NSViewIsCurrentlyBuildingLayerTreeForDisplay() != currentlyBuildingLayerTree), function NSViewSetCurrentlyBuildingLayerTreeForDisplay, file NSView.m, line 13477.

This problem only generate in my MacBook Air M1 with Mac OS 12.5.1, I trying the same code in other computer with Windows 10 and working.

I'm using the module DNN in OpenCV to Face recognition and it doesn't work, previously i used HaarCascade to this task and the problem didn't exist.

Any idea what could be happening? 😕

DiegoDG-01 avatar Sep 02 '22 20:09 DiegoDG-01

This seems to be a problem with the GUI implementation on Mac OS X. This stackoverflow post suggests you are not allowed to do GUI things outside of the main thread. Where are you calling cv2.imshow?

Nevertheless this looks like a problem with OpenCV and Mac OS X and not with djitellopy

M4GNV5 avatar Sep 25 '22 21:09 M4GNV5