123456789101112131415161718192021222324252627282930313233343536 |
- from file_util import *
- from db_util import getDiffEwkt
- from img_util import savePng
- from img_util import saveImage
- from img_util import getImageSize
- import re
- dirs = getDirList('img', '2024')
- for dir in dirs:
-
- allPathList = getAllFiles(dir+'/DDOM')
- for filePath in allPathList:
- print('tif路径:'+filePath)
- imageSize=getImageSize(filePath)
- if not(imageSize[0] ==256 and imageSize[1] == 256):
- print('图片尺寸不是256:',imageSize)
- continue
-
- ewkt = getTifEwkt(filePath)
-
- match = re.search(r'/DDOM/(.*)DDOM\.tif', filePath)
- code = match.group(1) if match else ''
- tbName=dir.replace('img/','')
- ewkt = getDiffEwkt(ewkt, tbName)
-
- savePng(code, ewkt, 'img/lable')
-
- saveImage(filePath,'img/A/'+code+'.tif')
- filePath=filePath.replace('DDOM','QDOM')
- saveImage(filePath,'img/B/'+code+'.tif')
|