OpenCv, Python3: No icons in the toolbar

跟風遠走 提交于 2019-12-12 09:47:56

问题


I am using Python 3.5 on Linux along with OpenCV 3.4.0 (installed by pip install opencv-python) to display the images from my webcam and I want to use the toolbar at the top of my frame. But the icons of this toolbar aren't shown. (I could use the Buttons without the icons, but where are the Icons)

Is there any way to get the usual icons or write Text instead of icons on these buttons. Here is my code:

import cv2
cv2.CascadeClassifier(cv2.data.haarcascades + "haarcascade_frontalface_default.xml")



def show_webcam():
    cam = cv2.VideoCapture(0)
    cv2.namedWindow("webcam", cv2.WINDOW_NORMAL|cv2.WINDOW_GUI_EXPANDED)
    cv2.resizeWindow('webcam', 800, 800)

    while True:
       ret_val, img1 = cam.read()
       cv2.imshow('webcam', img1)
       if cv2.waitKey(100)  == 27: # wait for Esc
           break
    cv2.destroyAllWindows()

show_webcam()

来源:https://stackoverflow.com/questions/49634045/opencv-python3-no-icons-in-the-toolbar

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!