首页 > 解决方案 > 如何在python中删除图像上的网格线?

问题描述

我正在为我的项目使用 google colab。即使我没有写它们,我也会在图像上得到网格线。

from matplotlib import pyplot as plt
%matplotlib inline
import cv2

img = cv2.imread('k15.jpg')

img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)

plt.imshow(img)

在此处输入图像描述

对于上面的代码,我得到了网格线,当我在我的 python shell 中运行相同的代码时,情况并非如此。

标签: pythonmatplotlibcomputer-visiongoogle-colaboratory

解决方案


plt.imshow(myImage)
plt.grid(None)   <---- this should remove that white grid

推荐阅读