helpers.py 文件源码

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

项目:TC-Lung_nodules_detection 作者: Shicoder 项目源码 文件源码
def load_cube_img(src_path, rows, cols, size):
    img = cv2.imread(src_path, cv2.IMREAD_GRAYSCALE)
    # assert rows * size == cube_img.shape[0]
    # assert cols * size == cube_img.shape[1]
    res = numpy.zeros((rows * cols, size, size))

    img_height = size
    img_width = size

    for row in range(rows):
        for col in range(cols):
            src_y = row * img_height
            src_x = col * img_width
            res[row * cols + col] = img[src_y:src_y + img_height, src_x:src_x + img_width]

    return res
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号