Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: How to Remove mouseCallback in OpenCV

Tags:

python

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,

like image 815
aaronsnoswell Avatar asked Dec 27 '17 08:12

aaronsnoswell


1 Answers

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

like image 59
Dani Avatar answered Sep 20 '22 01:09

Dani