问题遇到的现象和发生背景
想要用imwrite将缩放完后的图像保存到电脑中,但显示如下错误
用代码块功能插入代码,请勿粘贴截图
def Laplacian():
global imgout,img1
# 灰度化处理图像
grayImage = cv2.cvtColor(img1, cv2.COLOR_BGR2GRAY)
dst = cv2.Laplacian(grayImage, cv2.CV_16S, ksize=3)
Laplacian = cv2.convertScaleAbs(dst)
imgout = ImageTk.PhotoImage(Image.fromarray(Laplacian).resize((500,300),Image.ANTIALIAS))
print(type(imgout))
label.configure(text="Laplacian算子",image=imgout)
# cv2 BGR Image.open RGB
img1=imgout
cv2.imwrite(filepath,img1)
运行结果及报错内容
我想要达到的结果
能将其保存