zoukankan      html  css  js  c++  java
  • 新建全色或者resize(毫无价值,只是做记录)

    import glob
    import os,sys
    import shutil
    import numpy as np
    import cv2
    import matplotlib.pyplot as plt
    # fileDir = 'F:/project/Breast/InBreast/INBreast/outimgpatch/allnocalcification/'
    fileDir = 'F:/project/Breast/InBreast/INBreast/removeother/'
    source = 'F:/project/Breast/InBreast/INBreast/imgtest/20586960.png'
    tarDir = 'F:/project/Breast/InBreast/INBreast/labelblack/'    #源图片文件夹路径
    
    
    
    if __name__ == '__main__':
        txtLists = os.listdir(fileDir)  # 列出文件夹下所有的目录与文件
        img1 = cv2.imread(source)
        for filename in txtLists:
            print(filename)
            img = cv2.imread(fileDir + filename)
            print(type(img))
        #img = np.zeros((112, 112,3))  # cv2.imread('F:/project/Breast/InBreast/INBreast/outimgpatch/allnocalcification/20586908_1.png')
            img2 = cv2.resize(img1,(img.shape[1],img.shape[0]))
            # for i in range(img.shape[0]):
            #     for j in range(img.shape[1]):
            #         for k in range(3):
            #             img[i, j, k] = 0
            cv2.imwrite(tarDir+filename,img2)
    
    
        # plt.imshow(img)
        # plt.show()
    
        cv2.imwrite(tarDir + '1.png', img)
  • 相关阅读:
    html php插入百度地图定位
    thinkphp验证功能(部分)
    thinkphp用ajax注册及检测个人见解
    文件系统处理_下
    文件系统处理
    jQuery ajax
    jquery(复选框全选)
    jquery(鼠标)
    找房子(数据库应用)
    php基础题
  • 原文地址:https://www.cnblogs.com/ziytong/p/11216126.html
Copyright © 2011-2022 走看看