问题说明
最近在制作数据集,找了个.arw格式文档的数据集,又大又难受,开始通过polarr 转,胳膊都快断了,才折腾出一百多张图像,看着后面的一千多张,看来这样是不行的了。。。
Python下
初始是想matlab的,毕竟本命,没办法,sony arw识别不了,只能这样了。下面是代码(只提供借鉴啊,因为只是随手甩上来的,文件什么的好多都因为个人原因存在差异):
from __future__ import division
import os, scipy.io
import numpy as np
import rawpy
import glob
gt_dir = './label_2/' # 标记
input_dir = './input/' # 输入
result_dir = './input_1/' # 输出文件夹
test_fns = glob.glob(gt_dir + '0*.jpg')
test_ids = [int(os.path.basename(test_fn)[0:5]) for test_fn in test_fns]
for test_id in test_ids:
in_files = glob.glob(input_dir + '%05d_*.ARW' % test_id)
for k in range(len(in_files)):
in_path = in_files[k]
in_fn = os.path.basename(in_path)
in_fn_1 = in