创建一个任意大小的全色矩阵 python

img = np.zeros((112,112,3))#cv2.imread('F:/project/Breast/InBreast/INBreast/outimgpatch/allnocalcification/20586908_1.png')


    for i in range(112):
        for j in range(112):
            for k in range(3):
                img[i,j,k] = 0

    plt.imshow(img)
    plt.show()

    cv2.imwrite(tarDir + '1.png',img)

 

posted on 2019-07-19 16:29  Hebye  阅读(1142)  评论(0编辑  收藏  举报

导航