问题
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