# -*- coding: utf-8 -*-
"""
Created on Fri Dec 9 17:39:30 2022
@author: 38949
"""
#将uint16转为uint8
import os
from skimage import io, data, img_as_ubyte
read_path = r'D:/数据集/3/Sulu Sea'
save_path = r'D:/数据集/5/Sulu Sea'
for name in os.listdir(read_path):
new_path = os.path.join(read_path, name)
im = io.imread(new_path)
pic = data.chelsea()
uint8_pic = img_as_ubyte(im)
io.imsave(os.path.join(save_path, name), uint8_pic)
仅个人做笔记,怕找不到代码,原作者在这
https://blog.csdn.net/a_peng1/article/details/126846683
版权声明:本文为m0_56520034原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。