import os from PIL import Image I = Image.open(r'D:\xxxxx\sobel-operator-pytorch-master\sample-imgs\33.jpg') L = I.convert('L') L.save(r'D:\xxxxx\sobel-operator-pytorch-master\sample-imgs\1.png')
效果展示:
import os from PIL import Image I = Image.open(r'D:\xxxxx\sobel-operator-pytorch-master\sample-imgs\33.jpg') L = I.convert('L') L.save(r'D:\xxxxx\sobel-operator-pytorch-master\sample-imgs\1.png')
效果展示: