需要·import matplotlib.pyplot as plt
在前边写好自己要显示的图片,然后:
#两个窗口同时显示
fig1 = plt.figure() #创建第一个窗口
ax1 = fig1.add_subplot(1, 3, 1);plt.imshow(f, cmap='gray');plt.title('原始图像')
ax2 = fig1.add_subplot(1, 3, 2);plt.imshow(movedImg, cmap='gray');plt.title('平移图像')
ax3 = fig1.add_subplot(1, 3, 3);plt.imshow(rotatedImg, cmap='gray');plt.title('旋转图像')
fig2 = plt.figure() #创建第二个窗口
ax4 = fig2.add_subplot(2, 1, 1);plt.imshow(scaledImg1, cmap='gray');plt.title('等比缩放图像')
ax5 = fig2.add_subplot(2, 1, 2);plt.imshow(scaledImg2, cmap='gray');plt.title('非等比缩放图像')
plt.show()
cv2.waitKey()
cv2.destroyAllWindows()
就ok了
其他更多窗口的就以此类推了嘿嘿