Skip to content
Advertisement

Avoid recursion error with cv2 and mouse callback

I have a class for opening up an image and drawing circles. The entire code can be found here:

p1 and p2 store diametrically opposing points on a circle. These are capture with click and drag actions in _on_mouse_interact.

JavaScript

It can be run with

JavaScript

My issue is that I get

JavaScript

Where is the recursion here?

Advertisement

Answer

Found some time… Apparently, it’s the waitKey stuff. I moved some lines from the redraw to the __call__, and now, I don’t get the error anymore:

JavaScript

Could you please check, whether that works for you?

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement