为什么子图会改变我图像的颜色?

Why is subplot changing the color of my image?

我正在尝试从视频中提取一帧并将每一帧显示为图像。为了比较,我尝试了子图。绘制时读取的 RGB 图像不同。我哪里可能错了?

vid = cv2.VideoCapture(file1)
num_frames = int(vid.get(cv2.cv.CV_CAP_PROP_FRAME_COUNT))
fig, ax = plt.subplots(nrows=1, ncols=3)
plt.ion()
for i in range(num_frames):
    f,img = vid.read(i)
    cv2.imshow("V",img)

rgb 图像读取正确,但

for i in range(num_frames):
    f,img = vid.read(i)
    ax[0].imshow(img)
    ax[1].imshow(img)
    ax[2].imshow(img)
    plt.draw()
    plt.pause(0.01)

显示图像的颜色已更改 subplot image cv2 image

尝试

ax[0].imshow(cv2.cvtColor(img, cv2.COLOR_BGR2RGB))