I am trying to run the OpenCV Grabcut Sample on my system:
- OpenCV version 4.1.0
- Python version 3.6.8
- IDLE version 3.6.8
- Ubuntu 18.04.2
This is the build information from cv2.getBuildInformation()
:
In the Grabcut Sample script, I need to 'draw a rectangle around the object using the right mouse button.' For some reason, a drop down menu appears when I click the right mouse button (this is me clicking and holding the right mouse button):
This didn't happen before, but since I reformatted my computer and reinstalled OpenCV I get this drop down menu. The imshow
window looks different too. I tried installing lots of video codec packages (from this tutorial), but that didn't help.
This drop down menu interferes with the mouse callback functions. How can I get rid of this drop down menu?
I installed OpenCV with the command pip3 install opencv-contrib-python
. I knew I was missing some packages so I tried to install (but failed - 'couldn't find any package by regex...') these packages from this tutorial:
sudo apt-get install python-devel numpy
sudo apt-get install gcc gcc-c++
sudo apt-get install gtk2-devel
sudo apt-get install ffmpeg-devel
sudo apt-get install gstreamer-plugins-base-devel