2

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?

Rahul Kedia
  • 1,400
  • 6
  • 18

2 Answers2

0

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
Yunus Temurlenk
  • 4,085
  • 4
  • 18
  • 39
  • I am not sure. How to check which property I am using? CV_GUI_NORMAL or CV_GUI_EXPANDED. And how to switch between them? – Rahul Kedia Jul 13 '20 at 06:39
  • [Here](https://docs.opencv.org/4.2.0/d7/dfc/group__highgui.html#ga5afdf8410934fd099df85c75b2e0888b) and [here](https://stackoverflow.com/questions/35180764/opencv-python-image-too-big-to-display). Also check step-2 in [this article](https://www.learnopencv.com/install-opencv-4-on-ubuntu-18-04/), be sure you already installed required OS libraries. – Yunus Temurlenk Jul 13 '20 at 06:45
0

If you are using opencv 4.2

remove it and try opencv4.5

pip install opencv-contrib-python
Jai
  • 377
  • 2
  • 14