Guten Abend,
ich nehme eine Bild mit der Pi Kamera auf und möchte es als stream (wenn Bild in Datei geschrieben wird, funktioniert es) in einem Canvas (TKinter) darstellen:
...
cam=picamera.PiCamera(resolution=(b, h),framerate=30)
cam.rotation=int(rotation.get())
cam.iso = isowahl.ISOAuswahl()
time.sleep(1)
cam.shutter_speed = cam.exposure_speed
cam.exposure_mode = "off"
g=cam.awb_gains
cam.awb_mode = "off"
cam.awb_gains = g
cam.capture(stream, format="gif")
stream.seek(0)
cam.close()
stream.seek(0)
pic=PhotoImage(file=stream)
w.create_image(0,0, image=pic, anchor="nw")
...
Alles anzeigen
Es erscheint immer eine Fehlermeldung wie folgt:
[font="Courier New"]Exception in Tkinter callback
Traceback (most recent call last):
File "/usr/lib/python3.4/tkinter/__init__.py", line 1536, in __call__
return self.func(*args)
File "/home/pi/python/kamera/konfiguration_11_01.pyw", line 142, in takepicture
picshow()
File "/home/pi/python/kamera/konfiguration_11_01.pyw", line 150, in picshow
pic=PhotoImage(file=stream, format="gif")
File "/usr/lib/python3.4/tkinter/__init__.py", line 3419, in __init__
Image.__init__(self, 'photo', name, cnf, master, **kw)
File "/usr/lib/python3.4/tkinter/__init__.py", line 3375, in __init__
self.tk.call(('image', 'create', imgtype, name,) + options)
_tkinter.TclError: couldn't open "<_io.BytesIO object at 0x7466f538>": no such file or directory[/font]
Kann mir jemand weiterhelfen?
Vielen Dank.
whitechristmas