Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Toolbar, x/y coordinates, rgb color picker not showing in 4.5.x #516

Closed
3 of 4 tasks
donkawechico opened this issue Jul 20, 2021 · 3 comments
Closed
3 of 4 tasks
Labels

Comments

@donkawechico
Copy link

Similar to #213 except I'm not using conda, and my issue does not resolve by installing+uninstalling opencv-contrib-python. (FWIW, I tried installing conda and using conda install -c conda-forge opencv and this also does not resolve the issue.

Expected behaviour

cv2.imshow() should launch a window with a toolbar above the image output, and the x/y coordinates + rgb color picker below the image.

Actual behaviour

cv2.imshow() launches a window with just the image output. Neither the toolbar, the x/y coordinates, nor the rgb color picker are present.

When downgrading to 4.4.0.46, the window launches with the toolbar, x/y, and rgb successfully (but the toolbar has no icons).

opencv-contrib-python 4.5.x (No toolbar, no x/y, no rgb picker)

opencv-contrib-python 4.4.0.46 (Toolbar (but no icons), x/y, rgb picker):

Steps to reproduce

SETUP:

~/code/opencv-test > mkvirtualenv py3cv4
created virtual environment CPython3.9.1.final.0-64 in 4866ms
  creator CPython3Posix(dest=/Users/me/.virtualenvs/p3cv4, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/Users/me/Library/Application Support/virtualenv)
    added seed packages: pip==21.1.3, setuptools==57.1.0, wheel==0.36.2
  activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
[...]
in .zshenv
(py3cv4) ~/code/opencv-test >
(py3cv4) ~/code/opencv-test > pip install opencv-contrib-python
Collecting opencv-contrib-python
  Using cached opencv_contrib_python-4.5.3.56-cp39-cp39-macosx_10_15_x86_64.whl (51.4 MB)
Requirement already satisfied: numpy>=1.19.3 in /Users/me/.virtualenvs/p3cv4_2/lib/python3.9/site-packages (from opencv-contrib-python) (1.21.1)
Installing collected packages: opencv-contrib-python
Successfully installed opencv-contrib-python-4.5.3.56
(py3cv4) ~/code/opencv-test >
(py3cv4) ~/code/opencv-test >python main.py
(py3cv4) ~/code/opencv-test >

CODE:

# main.py

import cv2
import numpy as np

cv2.namedWindow("Foo")
starting_image = np.ones(shape=(50,50,3)).astype('uint8')
cv2.imshow("Foo", starting_image)
cv2.waitKey()
cv2.destroyAllWindows()
  • operating system: MacOS (Big Sur) 11.4
  • architecture (e.g. x86): x64
  • opencv-python version: 4.5.3.56 (but I tested on all 4.5.x available through pip)
Issue submission checklist
  • This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • I have read the README of this repository and understand that this repository provides only an automated build toolchain for OpenCV Python packages (there is no actual OpenCV code here)
  • The issue is related to the build scripts in this repository, to the pre-built binaries or is a feature request (such as "please enable this additional dependency")
  • I'm using the latest version of opencv-python
@asmorkalov
Copy link
Collaborator

@donkawechico Thanks for the report. OpenCV has several back-ends to manage windows and they produce windows with slightly different functionality. Before OpenCV 4.5.2 Mac package included build with Qt back-end and pre-built Qt library inside. Since OpenCV 4.5.2 the team decided to switch from Qt to native Mac UI API due to Qt support issues, Qt conflicts with other packages and package size. The cv.imshow with native Mac UI does not support pixel coordinates and other advanced Qt back-end features. So the new OpenCV behavior is expected.

@donkawechico
Copy link
Author

Ah! That completely makes sense.

I looked around the issues / release notes to see if something like that was the case, but only found (older) items talking about how it ships with QT.

Thanks for the reply and for all your work on this amazing project.

@donkawechico
Copy link
Author

I'll go ahead and close this item since I agree this should be a wontfix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants