opencv / opencv-python

Automated CI toolchain to produce precompiled opencv-python, opencv-python-headless, opencv-contrib-python and opencv-contrib-python-headless packages.
https://pypi.org/project/opencv-python/
MIT License
4.43k stars 833 forks source link

No icons in imshow() #585

Closed boris-gu closed 8 months ago

boris-gu commented 2 years ago

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
asmorkalov commented 2 years ago

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.

asmorkalov commented 2 years ago

Reproduced with 4.5.4.60 on Ubuntu 18.04 with KDE.

skvark commented 2 years ago

See earlier discussion about the icons here: https://github.com/opencv/opencv-python/issues/213#issuecomment-545286891

asmorkalov commented 2 years ago

@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.

jcbritobr commented 2 years ago

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?

decadenza commented 1 year ago

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

asmorkalov commented 1 year ago

https://github.com/opencv/opencv/pull/22885

asmorkalov commented 1 year ago

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.

atik1n commented 1 year ago

@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?

asmorkalov commented 1 year ago

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

jcbritobr commented 1 year ago

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..

decadenza commented 1 year ago

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.

Coderx7 commented 1 year ago

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!

asmorkalov commented 8 months ago

Finally fixed in 4.9.0.80. Related patch in main OpenCV: https://github.com/opencv/opencv/pull/24370