opencv-python icon indicating copy to clipboard operation
opencv-python copied to clipboard

No icons in imshow()

Open boris-gu opened this issue 2 years ago • 5 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
  • [x] This is not a generic OpenCV usage question (looking for help for coding, other usage questions, homework etc.)
  • [x] 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)
  • [x] 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: https://github.com/opencv/opencv-python/issues/572

boris-gu avatar Nov 14 '21 07:11 boris-gu

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 avatar Nov 22 '21 04:11 asmorkalov

Reproduced with 4.5.4.60 on Ubuntu 18.04 with KDE.

asmorkalov avatar Nov 22 '21 06:11 asmorkalov

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

skvark avatar Nov 22 '21 06:11 skvark

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

asmorkalov avatar Nov 22 '21 06:11 asmorkalov

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?

jcbritobr avatar Jan 03 '22 00:01 jcbritobr

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

decadenza avatar Nov 28 '22 11:11 decadenza

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

asmorkalov avatar Nov 29 '22 13:11 asmorkalov

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.

asmorkalov avatar Jan 20 '23 07:01 asmorkalov

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

atik1n avatar Feb 28 '23 13:02 atik1n

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

asmorkalov avatar Mar 01 '23 06:03 asmorkalov

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

jcbritobr avatar Mar 01 '23 13:03 jcbritobr

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.

decadenza avatar Mar 01 '23 14:03 decadenza

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!

Coderx7 avatar Sep 01 '23 18:09 Coderx7

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

asmorkalov avatar Jan 09 '24 11:01 asmorkalov