资源简介
在main函数里直接赋值文件夹(会递归文件夹内的所有文件夹),在每个子文件夹内会自动切分unity3d atlas图集。但是目录下需要有prefab png文件。
代码片段和文件信息
# -*- coding: utf-8 -*-
import os
import sys
import argparse
from PIL import Image
import re
def middle(str=‘‘left=‘‘right=‘‘):
# print str.index(rightstr.index(left)+1)
return str[str.index(left)+len(left):str.find(rightstr.find(left)+1)]
def MakePath(prefab_path out_path=‘.‘):
prefab_file = open(prefab_path+‘.prefab‘)
pngname=‘‘
x=0
y=0
w=0
h=0
while 1:
line= prefab_file.readline()
if not line:
break;
if line.startswith(‘ - name: ‘):
pngname=middle(line‘ - name: ‘‘\r\n‘)
if line.startswith(‘ x: ‘):
x=int(middle(line‘ x: ‘‘\r\n‘))
if line.startswith(‘ y: ‘):
y=int(middle(line‘ y: ‘‘\r\n‘))
if line.startswith(‘ width: ‘):
w=int(middle(line‘ width: ‘‘\r\n‘))
if line.startswith(‘ height: ‘):
h=int(middle(line‘ height: ‘‘\r\n‘))
print pngnamexywh
img = Image.open(prefab_path+‘.png‘)
region = (xyw+xh+y)
cropimg=img.crop(region)
cropimg.save(out_path+‘/‘+pngname+‘ST.png‘)
def get_filelist(dir Filelist):
newDir
相关资源
- 计算机视觉 opencv 超像素分割.ipynb
- 机器学习k means算法实现图像分割
- 卷积神经网络在医学图像分割中的研
- MNIST手写体数字训练/测试数据集(图
- 图像分割-snake算法 python版本
- Python-心脏核磁共振MRI图像分割
- Python-UNet用于医学图像分割的嵌套UN
- Python-TensorFlow弱监督图像分割
- Python-FastSCNN的PyTorch实现快速语义分割
- 语义分割代码(网盘)
- LIDC-IDRI-nodule-segmentation-master.zip
- 图像分割Grabcut算法-GUI程序-python实现
- python_点云的地面分割,以及非点云数
- 粘连细胞分割.zip
- 语义分割PSPNet
- 图像分割python实现代码
- Python-图像分类目标检测姿态估计分割
- Python-CENet用于2D医学图像分割的上下文
- newtest.py
- Python-PointSIFT一种类似SIFT的网络模块用
- 论文研究-基于Python与OpenCV的舌象分割
- 显著性目标检测、分割任务实验评价
- unitypackage文件解压工具
- splitAtlasEx.py
- 基于selective_search对手写数字串进行分
- 基于区域的图像分割python源代码
- 视杯分割增强数据
- python版本的GrabCut前景分割和分水岭分
- 肺实质分割python代码
- Chan-Vese分割
评论
共有 条评论