【发布时间】:2021-12-10 08:43:04
【问题描述】:
使用此代码时:
start_point = (centerXList[i] +16,centerYList[i]-14)
end_point = (centerXList[i]+50,centerYList[i]+24)
color=(255,0,0)
x1=cv2.rectangle(x1,start_point,end_point,color)
imshow(x1)
plt.show()
imshow的结果是:
但是当使用以下方式保存图像时:
save_img("./Predicted Images/abc.jpeg", x1)
结果是:
https://drive.google.com/file/d/1A4q1buJJk9tBWfstQccgETHe8LDEOtxX/view?usp=sharing
我想保存与 imshow 显示的图像相同的图像。 该怎么做?
提前致谢
【问题讨论】:
-
您共享的代码可以正常工作。问题是,之前在您的
plt中添加了一张图片。要同时显示图像,请在使用plt.imshow(img)之前附加图像
标签: python opencv matplotlib