Q3D-Calibration/main.py

31 lines
643 B
Python
Raw Normal View History

2022-07-08 21:21:48 +08:00
import os
import re
import numpy as np
from tqdm import tqdm
from qdx import BindFilter, Bind
binds = []
BF = BindFilter()
path = 'result/bind'
file_list = os.listdir(path)
reg = re.compile(r'(([0-9]{4})-([0-9])-([0.9])).txt')
pbar = tqdm(desc="Gaussian Mixture Bind Filter", total=len(file_list))
for file in file_list:
name, E, n, m = reg.match(file).groups()
file = os.path.join(path, file)
BF(file)
BF.draw('result/GMM/' + name + '.png')
np.savetxt('result/bind-GMM/' + name + '.txt', BF.fit_data, fmt='%d')
binds.append(Bind(int(E), int(n), int(m), BF.fit_data))
pbar.update(1)
break
pbar.close()