import os
import cv2
dirs="./3/"
out_dir="./output/3/"
fnames=os.listdir(dirs)
for f in fnames:
print(f)
img=cv2.imread(dirs+f,cv2.IMREAD_COLOR)
#print(img.shape)
cv2.imwrite(out_dir+f,img)
print("done")
import os
import cv2
dirs="./3/"
out_dir="./output/3/"
fnames=os.listdir(dirs)
for f in fnames:
print(f)
img=cv2.imread(dirs+f,cv2.IMREAD_COLOR)
#print(img.shape)
cv2.imwrite(out_dir+f,img)
print("done")
本文标题:批量读取黑白图像,变成三通道后保存
本文链接:https://www.haomeiwen.com/subject/lemgbqtx.html
网友评论