Pixel coordinates and colours not showing

Viewed 796

I have recently updated my ubuntu 16 to ubuntu 20.04. I use OpenCV(4.2.0) with Python(3.8.2).

Earlier on showing images using cv2.imshow() (in ubuntu 16), the image was shown and also the coordinates and RGB color values for the pixel where my mouse cursor was kept were also shown at the bottom of the image window but now after updating ubuntu, they are not shown.

Can somebody please help me with a solution to this?

2 Answers

You are probably using CV_GUI_NORMAL property. This one shows no statusbar or toolbar. As the documentation says:

CV_GUI_NORMAL is the old way to draw the window without statusbar and toolbar, whereas CV_GUI_EXPANDED is a new enhanced GUI.

If you use CV_WINDOW_NORMAL property with imshow, you can see basic toolbars,statusbars etc.

Note: I assumed you already installed Qt backend supports for your new environment. If you didnt, you can install by using the command:

sudo apt -y install libgtk2.0-dev libtbb-dev qt5-default

If you are using opencv 4.2

remove it and try opencv4.5

pip install opencv-contrib-python
Related