aaronsnoswell
aaronsnoswell

Reputation: 6251

Python: How to Remove mouseCallback in OpenCV

With OpenCV and Python, is there any way to remove the mouse callback set with cv2.setMouseCallback(window_name, function_name)? Passing None for the function name gives;

TypeError: on_mouse must be callable

This is a duplicate of How to Remove mouseCallback in OpenCV, but for Python, not C++.

Thanks,

Upvotes: 11

Views: 3940

Answers (1)

Dani
Dani

Reputation: 609

For me, cv2.setMouseCallback(window_name, lambda *args : None) did the trick and it seems clean enough.

Upvotes: 12

Related Questions