我需要将这两个函数放在tkinter窗口中并一起显示:
import cv2
import tkinter as tk
from PIL import Image , ImageTk
root=tk.Tk()
def draw(self):
image = Image.open(self.filename)
angle = 0
while True:
for i in range(len(arr)):
tkimage = ImageTk.PhotoImage(image.rotate(angle))
canvas_obj = self.Canvas1.create_image(
250, 250, image=tkimage)
self.master.after_idle(self.update)
yield
self.Canvas1.delete(canvas_obj)
angle = arr[i]
print(angle)
time.sleep(.1)
def cv():
path = 'E:/Autopilot-TensorFlow-master/driving_dataset/'
cv2.namedWindow('image', cv2.WINDOW_AUTOSIZE)
j = 0
for j in range(10000):
image_name = str(j) + '.jpg'
image_path = path + image_name
img = cv2.imread(image_path, 0)
cv2.imshow('image', img)
if cv2.waitKey(1) & 0xFF == ord('q'):
break