So currently I'm reading images into my Python project with the cv2.imread()
function, but it would be much cooler if I could go to my user interface, which I created with the tkinter
module, and choose my picture from my Windows Explorer.
I found this function in Internet. If I use this my Windows explorer opens and I can select my picture, but nothing happens afterwards. I want save the picture in img
but it doesnt work. Do you know what the problem is?
path = tkinter.filedialog.askopenfilename(title='select', filetypes='.png')
img = cv2.imread(path, 1)
question from:
https://stackoverflow.com/questions/65851139/tkinter-filedialog-askopenfilename-function-how-can-i-use-it 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…