forked from Sarrasor/RoboticManipulators
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdataset_parameters.py
33 lines (23 loc) · 870 Bytes
/
dataset_parameters.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import scipy.io
import numpy as np
def main():
mat = scipy.io.loadmat('data/calibration_dataset.mat')
pts1 = np.array(mat['mA'], dtype=np.float)[:, :, np.newaxis]
pts2 = np.array(mat['mB'], dtype=np.float)[:, :, np.newaxis]
pts3 = np.array(mat['mC'], dtype=np.float)[:, :, np.newaxis]
np.set_printoptions(suppress=True, precision=10)
dev1 = dev2 = dev3 = 0.0
for i in range(24):
dev1 += np.sqrt(np.var(pts1[i * 10:(i + 1) * 10] * 1000, axis=0))
dev2 += np.sqrt(np.var(pts2[i * 10:(i + 1) * 10] * 1000, axis=0))
dev3 += np.sqrt(np.var(pts3[i * 10:(i + 1) * 10] * 1000, axis=0))
dev1 /= 24
dev2 /= 24
dev3 /= 24
dev = (dev1 + dev2 + dev3) / 3
print("Coordinatewise deviation: ")
print(dev)
print("Average deviation")
print(np.sum(dev) / 3)
if __name__ == '__main__':
main()