opencv / opencv-python

Automated CI toolchain to produce precompiled opencv-python, opencv-python-headless, opencv-contrib-python and opencv-contrib-python-headless packages.

Home Page:https://pypi.org/project/opencv-python/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

No icons in imshow()

boris-gu opened this issue · comments

Expected behaviour

When using the imshow() function, a window appears, at the top there are various buttons

Actual behaviour

Buttons work, but they do not display icons

Buttons work, but they do not display icons

Steps to reproduce

  1. Install pip install opencv-contrib-python==4.5.3.56
  2. Run this code
import cv2
cap = cv2.VideoCapture(0)
if not cap.isOpened():
    print("Cannot open camera")
    exit()
while True:
    ret, frame = cap.read()
    if not ret:
        print("Can't receive frame (stream end?). Exiting ...")
        break
    cv2.imshow('frame', frame)
    if cv2.waitKey(1) != -1:
        break
cap.release()
cv2.destroyAllWindows()
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
    I am not using the latest version due to this error: #572

Thanks for the report. Could you provide more details on your setup: OS, Python version, other packages used in your project, DE information, if you use Linux.

Reproduced with 4.5.4.60 on Ubuntu 18.04 with KDE.

See earlier discussion about the icons here: #213 (comment)

@skvark Thanks a lot for details. The icons are not part of binary distro by legal reason.
The license does not permit the following uses:

  1. The icons may not be resold, sublicensed, rented, transferred or otherwise made available for use or detached from a product, software application or web page;
  2. The icons may not be placed on any electronic bulletin board or downloadable format;

I'll talk to OpenCV core team to resolve the legal issue or replace the icons with Apache 2 compatible one.

Reproduced here with linux mint 20.02 x64
opencv-contrib-python 4.5.5.62

Maybe use another iconset with a more permissive license solves this issue?

Any update? Maybe fallback on different open source icons to have an usable OpenCV window?
Anyone is able to indicate the path where the icons are expected to be? Cheers

There is bug in OpenCV build system that prevents icons inclusion to static OpenCV build (-DBUILD_SHARED_LIBS=OFF). Will work on it for the next release.

@skvark, @asmorkalov, any updates regarding this issue?
As I can see, icons PR was merged (opencv/opencv#22885) but is OpenCV build problem was fixed and updated in package?

Icons themself is not the only piece in the puzzle unfortunately. I'll try to cover the issue for the next release.

Icons themself is not the only piece in the puzzle unfortunately. I'll try to cover the issue for the next release.

This is the only issue thats really is boring during development. When looking the image in viewer, we cant see what button to press to save, etc...
Get this fixed will be very nice..

Another possibility could be to just use alternative icons to quickly fix only this issue. If someone writes down the requirements and the list of the icons, I can make simple and lightweight icons with no licence to be temporarily integrated.

I'm facing this on the latest version of opencv (4.8.0) as well. is this still expected or am I dealing with sth entirely different?
I noticed the conda version has icons (though that version is 4.6.0) though!

Finally fixed in 4.9.0.80. Related patch in main OpenCV: opencv/opencv#24370