data_reader.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:han 作者: croath 项目源码 文件源码
def get_real_images(paths):
    real_images = []
    for path in paths:
        # Calculate a threshold to do image binarization, all colors at every pixel will be translated to number 0(white) or 1(black)
        camera = io.imread(path)
        val = filters.threshold_otsu(camera)
        result = (camera < val)*1.0
        real_images.append(result)
    np_images = numpy.array(real_images)
    np_images = np_images.reshape(np_images.shape[0], np_images.shape[1] * np_images.shape[2])
    return np_images
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号