migrated code to public repository
This commit is contained in:
parent
a7df82d7a4
commit
f34dc653e5
233 changed files with 16279 additions and 186 deletions
944
code/Visualization/1CalibrationDepth.py
Normal file
944
code/Visualization/1CalibrationDepth.py
Normal file
|
@ -0,0 +1,944 @@
|
|||
import os, sys
|
||||
import seaborn
|
||||
from pylab import rcParams
|
||||
import cv2
|
||||
|
||||
import numpy as np
|
||||
from numpy import linalg as LA
|
||||
from time import time
|
||||
from itertools import combinations
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib.pyplot import *
|
||||
import matplotlib.patches as mpatches
|
||||
|
||||
# activate latex text rendering
|
||||
#rc('text', usetex=True)
|
||||
|
||||
def main(argv):
|
||||
# path = str(argv[0])
|
||||
path ="/home/mmbrian/3D_Gaze_Tracking/work/results/2D2D/"
|
||||
|
||||
Data1 = np.load(path + "p5_2d2d_all.npy")
|
||||
Data2 = np.load(path + "p7_2d2d_all.npy")
|
||||
Data3 = np.load(path + "p10_2d2d_all.npy")
|
||||
Data4 = np.load(path + "p11_2d2d_all.npy")
|
||||
Data5 = np.load(path + "p12_2d2d_all.npy")
|
||||
Data6 = np.load(path + "p13_2d2d_all.npy")
|
||||
Data7 = np.load(path + "p14_2d2d_all.npy")
|
||||
Data8 = np.load(path + "p15_2d2d_all.npy")
|
||||
Data9 = np.load(path + "p16_2d2d_all.npy")
|
||||
Data10 = np.load(path + "p20_2d2d_all.npy")
|
||||
Data11 = np.load(path + "p21_2d2d_all.npy")
|
||||
Data12 = np.load(path + "p24_2d2d_all.npy")
|
||||
Data13 = np.load(path + "p25_2d2d_all.npy")
|
||||
Data14 = np.load(path + "p26_2d2d_all.npy")
|
||||
|
||||
Data = [Data1,Data2,Data3,Data4,Data5,Data6,Data7,Data8,Data9,Data10,Data11,Data12,Data13,Data14]
|
||||
|
||||
Participantmean = []
|
||||
for i in xrange(5):
|
||||
Participantmean.append(float(0))
|
||||
yerrup = []
|
||||
for i in xrange(5):
|
||||
yerrup.append(float(0))
|
||||
yerrdown = []
|
||||
for i in xrange(5):
|
||||
yerrdown.append(float(0))
|
||||
|
||||
maxvalue = []
|
||||
for i in xrange(5):
|
||||
maxvalue.append(float(0))
|
||||
minvalue = []
|
||||
for i in xrange(5):
|
||||
minvalue.append(float(0))
|
||||
|
||||
Activitymax = []
|
||||
for i in xrange(5):
|
||||
Activitymax.append([])
|
||||
for j in xrange(15):
|
||||
Activitymax[i].append(float(0))
|
||||
|
||||
Activitymin = []
|
||||
for i in xrange(5):
|
||||
Activitymin.append([])
|
||||
for j in xrange(15):
|
||||
Activitymin[i].append(float(0))
|
||||
|
||||
AngularerrorC1 = []
|
||||
for i in xrange(5):
|
||||
AngularerrorC1.append([])
|
||||
for j in xrange(14):
|
||||
AngularerrorC1[i].append(float(0))
|
||||
|
||||
AngularerrorC2 = []
|
||||
for i in xrange(5):
|
||||
AngularerrorC2.append([])
|
||||
for j in xrange(14):
|
||||
AngularerrorC2[i].append(float(0))
|
||||
|
||||
AngularerrorC3 = []
|
||||
for i in xrange(5):
|
||||
AngularerrorC3.append([])
|
||||
for j in xrange(14):
|
||||
AngularerrorC3[i].append(float(0))
|
||||
|
||||
AngularerrorC4 = []
|
||||
for i in xrange(5):
|
||||
AngularerrorC4.append([])
|
||||
for j in xrange(14):
|
||||
AngularerrorC4[i].append(float(0))
|
||||
|
||||
AngularerrorC5 = []
|
||||
for i in xrange(5):
|
||||
AngularerrorC5.append([])
|
||||
for j in xrange(14):
|
||||
AngularerrorC5[i].append(float(0))
|
||||
|
||||
# C1
|
||||
distance = 1.0
|
||||
i = 0
|
||||
while i < 14:
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.0 and Data[i][j][0] == distance:
|
||||
AngularerrorC1[0][i] = Data[i][j][7]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
print "i: ", i," j: ", j
|
||||
if Data[i][j][1] == 1.25 and Data[i][j][0] == distance:
|
||||
print Data[i][j][7]
|
||||
AngularerrorC1[1][i] = Data[i][j][7]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.5 and Data[i][j][0] == distance:
|
||||
AngularerrorC1[2][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.75 and Data[i][j][0] == distance:
|
||||
AngularerrorC1[3][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 2.0 and Data[i][j][0] == distance:
|
||||
AngularerrorC1[4][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
print "AngularerrorC1: ", AngularerrorC1[0]
|
||||
print "AngularerrorC1: ", AngularerrorC1[1]
|
||||
print "AngularerrorC1: ", AngularerrorC1[2]
|
||||
print "AngularerrorC1: ", AngularerrorC1[3]
|
||||
print "AngularerrorC1: ", AngularerrorC1[4]
|
||||
|
||||
meanC1D1 = np.mean(AngularerrorC1[0])
|
||||
meanC1D2 = np.mean(AngularerrorC1[1])
|
||||
meanC1D3 = np.mean(AngularerrorC1[2])
|
||||
meanC1D4 = np.mean(AngularerrorC1[3])
|
||||
meanC1D5 = np.mean(AngularerrorC1[4])
|
||||
|
||||
stdC1D1 = np.std(AngularerrorC1[0])
|
||||
stdC1D2 = np.std(AngularerrorC1[1])
|
||||
stdC1D3 = np.std(AngularerrorC1[2])
|
||||
stdC1D4 = np.std(AngularerrorC1[3])
|
||||
stdC1D5 = np.std(AngularerrorC1[4])
|
||||
|
||||
meanC1 = [meanC1D1,meanC1D2,meanC1D3,meanC1D4,meanC1D5]
|
||||
stdC1 = [stdC1D1,stdC1D2,stdC1D3,stdC1D4,stdC1D5]
|
||||
|
||||
# C2
|
||||
distance = 1.25
|
||||
i = 0
|
||||
while i < 14:
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.0 and Data[i][j][0] == distance:
|
||||
AngularerrorC2[0][i] = Data[i][j][7]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
print "i: ", i," j: ", j
|
||||
if Data[i][j][1] == 1.25 and Data[i][j][0] == distance:
|
||||
print Data[i][j][7]
|
||||
AngularerrorC2[1][i] = Data[i][j][7]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.5 and Data[i][j][0] == distance:
|
||||
AngularerrorC2[2][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.75 and Data[i][j][0] == distance:
|
||||
AngularerrorC2[3][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 2.0 and Data[i][j][0] == distance:
|
||||
AngularerrorC2[4][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
print "AngularerrorC2: ", AngularerrorC2[0]
|
||||
print "AngularerrorC2: ", AngularerrorC2[1]
|
||||
print "AngularerrorC2: ", AngularerrorC2[2]
|
||||
print "AngularerrorC2: ", AngularerrorC2[3]
|
||||
print "AngularerrorC2: ", AngularerrorC2[4]
|
||||
|
||||
meanC2D1 = np.mean(AngularerrorC2[0])
|
||||
meanC2D2 = np.mean(AngularerrorC2[1])
|
||||
meanC2D3 = np.mean(AngularerrorC2[2])
|
||||
meanC2D4 = np.mean(AngularerrorC2[3])
|
||||
meanC2D5 = np.mean(AngularerrorC2[4])
|
||||
|
||||
stdC2D1 = np.std(AngularerrorC2[0])
|
||||
stdC2D2 = np.std(AngularerrorC2[1])
|
||||
stdC2D3 = np.std(AngularerrorC2[2])
|
||||
stdC2D4 = np.std(AngularerrorC2[3])
|
||||
stdC2D5 = np.std(AngularerrorC2[4])
|
||||
|
||||
meanC2 = [meanC2D1,meanC2D2,meanC2D3,meanC2D4,meanC2D5]
|
||||
stdC2 = [stdC2D1,stdC2D2,stdC2D3,stdC2D4,stdC2D5]
|
||||
|
||||
# C3
|
||||
distance = 1.5
|
||||
i = 0
|
||||
while i < 14:
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.0 and Data[i][j][0] == distance:
|
||||
AngularerrorC3[0][i] = Data[i][j][7]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
print "i: ", i," j: ", j
|
||||
if Data[i][j][1] == 1.25 and Data[i][j][0] == distance:
|
||||
print Data[i][j][7]
|
||||
AngularerrorC3[1][i] = Data[i][j][7]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.5 and Data[i][j][0] == distance:
|
||||
AngularerrorC3[2][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.75 and Data[i][j][0] == distance:
|
||||
AngularerrorC3[3][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 2.0 and Data[i][j][0] == distance:
|
||||
AngularerrorC3[4][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
print "AngularerrorC3: ", AngularerrorC3[0]
|
||||
print "AngularerrorC3: ", AngularerrorC3[1]
|
||||
print "AngularerrorC3: ", AngularerrorC3[2]
|
||||
print "AngularerrorC3: ", AngularerrorC3[3]
|
||||
print "AngularerrorC3: ", AngularerrorC3[4]
|
||||
|
||||
meanC3D1 = np.mean(AngularerrorC3[0])
|
||||
meanC3D2 = np.mean(AngularerrorC3[1])
|
||||
meanC3D3 = np.mean(AngularerrorC3[2])
|
||||
meanC3D4 = np.mean(AngularerrorC3[3])
|
||||
meanC3D5 = np.mean(AngularerrorC3[4])
|
||||
|
||||
stdC3D1 = np.std(AngularerrorC3[0])
|
||||
stdC3D2 = np.std(AngularerrorC3[1])
|
||||
stdC3D3 = np.std(AngularerrorC3[2])
|
||||
stdC3D4 = np.std(AngularerrorC3[3])
|
||||
stdC3D5 = np.std(AngularerrorC3[4])
|
||||
|
||||
meanC3 = [meanC3D1,meanC3D2,meanC3D3,meanC3D4,meanC3D5]
|
||||
stdC3 = [stdC3D1,stdC3D2,stdC3D3,stdC3D4,stdC3D5]
|
||||
|
||||
# C4
|
||||
distance = 1.75
|
||||
i = 0
|
||||
while i < 14:
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.0 and Data[i][j][0] == distance:
|
||||
AngularerrorC4[0][i] = Data[i][j][7]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
print "i: ", i," j: ", j
|
||||
if Data[i][j][1] == 1.25 and Data[i][j][0] == distance:
|
||||
print Data[i][j][7]
|
||||
AngularerrorC4[1][i] = Data[i][j][7]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.5 and Data[i][j][0] == distance:
|
||||
AngularerrorC4[2][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.75 and Data[i][j][0] == distance:
|
||||
AngularerrorC4[3][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 2.0 and Data[i][j][0] == distance:
|
||||
AngularerrorC4[4][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
print "AngularerrorC4: ", AngularerrorC4[0]
|
||||
print "AngularerrorC4: ", AngularerrorC4[1]
|
||||
print "AngularerrorC4: ", AngularerrorC4[2]
|
||||
print "AngularerrorC4: ", AngularerrorC4[3]
|
||||
print "AngularerrorC4: ", AngularerrorC4[4]
|
||||
|
||||
meanC4D1 = np.mean(AngularerrorC4[0])
|
||||
meanC4D2 = np.mean(AngularerrorC4[1])
|
||||
meanC4D3 = np.mean(AngularerrorC4[2])
|
||||
meanC4D4 = np.mean(AngularerrorC4[3])
|
||||
meanC4D5 = np.mean(AngularerrorC4[4])
|
||||
|
||||
stdC4D1 = np.std(AngularerrorC4[0])
|
||||
stdC4D2 = np.std(AngularerrorC4[1])
|
||||
stdC4D3 = np.std(AngularerrorC4[2])
|
||||
stdC4D4 = np.std(AngularerrorC4[3])
|
||||
stdC4D5 = np.std(AngularerrorC4[4])
|
||||
|
||||
meanC4 = [meanC4D1,meanC4D2,meanC4D3,meanC4D4,meanC4D5]
|
||||
stdC4 = [stdC4D1,stdC4D2,stdC4D3,stdC4D4,stdC4D5]
|
||||
|
||||
# C5
|
||||
distance = 2.0
|
||||
i = 0
|
||||
while i < 14:
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.0 and Data[i][j][0] == distance:
|
||||
AngularerrorC5[0][i] = Data[i][j][7]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
print "i: ", i," j: ", j
|
||||
if Data[i][j][1] == 1.25 and Data[i][j][0] == distance:
|
||||
print Data[i][j][7]
|
||||
AngularerrorC5[1][i] = Data[i][j][7]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.5 and Data[i][j][0] == distance:
|
||||
AngularerrorC5[2][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 1.75 and Data[i][j][0] == distance:
|
||||
AngularerrorC5[3][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Data[i][j][1] == 2.0 and Data[i][j][0] == distance:
|
||||
AngularerrorC5[4][i] = Data[i][j][7]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
print "AngularerrorC5: ", AngularerrorC5[0]
|
||||
print "AngularerrorC5: ", AngularerrorC5[1]
|
||||
print "AngularerrorC5: ", AngularerrorC5[2]
|
||||
print "AngularerrorC5: ", AngularerrorC5[3]
|
||||
print "AngularerrorC5: ", AngularerrorC5[4]
|
||||
|
||||
meanC5D1 = np.mean(AngularerrorC5[0])
|
||||
meanC5D2 = np.mean(AngularerrorC5[1])
|
||||
meanC5D3 = np.mean(AngularerrorC5[2])
|
||||
meanC5D4 = np.mean(AngularerrorC5[3])
|
||||
meanC5D5 = np.mean(AngularerrorC5[4])
|
||||
|
||||
stdC5D1 = np.std(AngularerrorC5[0])
|
||||
stdC5D2 = np.std(AngularerrorC5[1])
|
||||
stdC5D3 = np.std(AngularerrorC5[2])
|
||||
stdC5D4 = np.std(AngularerrorC5[3])
|
||||
stdC5D5 = np.std(AngularerrorC5[4])
|
||||
|
||||
meanC5 = [meanC5D1,meanC5D2,meanC5D3,meanC5D4,meanC5D5]
|
||||
stdC5 = [stdC5D1,stdC5D2,stdC5D3,stdC5D4,stdC5D5]
|
||||
|
||||
#######################################################################################
|
||||
|
||||
|
||||
path ="/home/mmbrian/3D_Gaze_Tracking/work/results/2D3D/"
|
||||
|
||||
Datatwo1 = np.load(path + "p5_2d3d_all.npy")
|
||||
Datatwo2 = np.load(path + "p7_2d3d_all.npy")
|
||||
Datatwo3 = np.load(path + "p10_2d3d_all.npy")
|
||||
Datatwo4 = np.load(path + "p11_2d3d_all.npy")
|
||||
Datatwo5 = np.load(path + "p12_2d3d_all.npy")
|
||||
Datatwo6 = np.load(path + "p13_2d3d_all.npy")
|
||||
Datatwo7 = np.load(path + "p14_2d3d_all.npy")
|
||||
Datatwo8 = np.load(path + "p15_2d3d_all.npy")
|
||||
Datatwo9 = np.load(path + "p16_2d3d_all.npy")
|
||||
Datatwo10 = np.load(path + "p20_2d3d_all.npy")
|
||||
Datatwo11 = np.load(path + "p21_2d3d_all.npy")
|
||||
Datatwo12 = np.load(path + "p24_2d3d_all.npy")
|
||||
Datatwo13 = np.load(path + "p25_2d3d_all.npy")
|
||||
Datatwo14 = np.load(path + "p26_2d3d_all.npy")
|
||||
|
||||
Datatwo = [Datatwo1,Datatwo2,Datatwo3,Datatwo4,Datatwo5,Datatwo6,Datatwo7,Datatwo8,Datatwo9,Datatwo10,Datatwo11,Datatwo12,Datatwo13,Datatwo14]
|
||||
|
||||
Participantmean = []
|
||||
for i in xrange(5):
|
||||
Participantmean.append(float(0))
|
||||
yerrup = []
|
||||
for i in xrange(5):
|
||||
yerrup.append(float(0))
|
||||
yerrdown = []
|
||||
for i in xrange(5):
|
||||
yerrdown.append(float(0))
|
||||
|
||||
maxvalue = []
|
||||
for i in xrange(5):
|
||||
maxvalue.append(float(0))
|
||||
minvalue = []
|
||||
for i in xrange(5):
|
||||
minvalue.append(float(0))
|
||||
|
||||
Activitymax = []
|
||||
for i in xrange(5):
|
||||
Activitymax.append([])
|
||||
for j in xrange(15):
|
||||
Activitymax[i].append(float(0))
|
||||
|
||||
Activitymin = []
|
||||
for i in xrange(5):
|
||||
Activitymin.append([])
|
||||
for j in xrange(15):
|
||||
Activitymin[i].append(float(0))
|
||||
|
||||
AngularerrortwoC1 = []
|
||||
for i in xrange(5):
|
||||
AngularerrortwoC1.append([])
|
||||
for j in xrange(14):
|
||||
AngularerrortwoC1[i].append(float(0))
|
||||
|
||||
AngularerrortwoC2 = []
|
||||
for i in xrange(5):
|
||||
AngularerrortwoC2.append([])
|
||||
for j in xrange(14):
|
||||
AngularerrortwoC2[i].append(float(0))
|
||||
|
||||
AngularerrortwoC3 = []
|
||||
for i in xrange(5):
|
||||
AngularerrortwoC3.append([])
|
||||
for j in xrange(14):
|
||||
AngularerrortwoC3[i].append(float(0))
|
||||
|
||||
AngularerrortwoC4 = []
|
||||
for i in xrange(5):
|
||||
AngularerrortwoC4.append([])
|
||||
for j in xrange(14):
|
||||
AngularerrortwoC4[i].append(float(0))
|
||||
|
||||
AngularerrortwoC5 = []
|
||||
for i in xrange(5):
|
||||
AngularerrortwoC5.append([])
|
||||
for j in xrange(14):
|
||||
AngularerrortwoC5[i].append(float(0))
|
||||
|
||||
# C1
|
||||
distance = 1.0
|
||||
i = 0
|
||||
while i < 14:
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.0 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC1[0][i] = Datatwo[i][j][2]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
print "i: ", i," j: ", j
|
||||
if Datatwo[i][j][1] == 1.25 and Datatwo[i][j][0] == distance:
|
||||
print Datatwo[i][j][7]
|
||||
AngularerrortwoC1[1][i] = Datatwo[i][j][2]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.5 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC1[2][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.75 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC1[3][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 2.0 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC1[4][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
print "AngularerrortwoC1: ", AngularerrortwoC1[0]
|
||||
print "AngularerrortwoC1: ", AngularerrortwoC1[1]
|
||||
print "AngularerrortwoC1: ", AngularerrortwoC1[2]
|
||||
print "AngularerrortwoC1: ", AngularerrortwoC1[3]
|
||||
print "AngularerrortwoC1: ", AngularerrortwoC1[4]
|
||||
|
||||
meantwoC1D1 = np.mean(AngularerrortwoC1[0])
|
||||
meantwoC1D2 = np.mean(AngularerrortwoC1[1])
|
||||
meantwoC1D3 = np.mean(AngularerrortwoC1[2])
|
||||
meantwoC1D4 = np.mean(AngularerrortwoC1[3])
|
||||
meantwoC1D5 = np.mean(AngularerrortwoC1[4])
|
||||
|
||||
stdtwoC1D1 = np.std(AngularerrortwoC1[0])
|
||||
stdtwoC1D2 = np.std(AngularerrortwoC1[1])
|
||||
stdtwoC1D3 = np.std(AngularerrortwoC1[2])
|
||||
stdtwoC1D4 = np.std(AngularerrortwoC1[3])
|
||||
stdtwoC1D5 = np.std(AngularerrortwoC1[4])
|
||||
|
||||
meantwoC1 = [meantwoC1D1,meantwoC1D2,meantwoC1D3,meantwoC1D4,meantwoC1D5]
|
||||
stdtwoC1 = [stdtwoC1D1,stdtwoC1D2,stdtwoC1D3,stdtwoC1D4,stdtwoC1D5]
|
||||
|
||||
# C2
|
||||
distance = 1.25
|
||||
i = 0
|
||||
while i < 14:
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.0 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC2[0][i] = Datatwo[i][j][2]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
print "i: ", i," j: ", j
|
||||
if Datatwo[i][j][1] == 1.25 and Datatwo[i][j][0] == distance:
|
||||
print Datatwo[i][j][7]
|
||||
AngularerrortwoC2[1][i] = Datatwo[i][j][2]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.5 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC2[2][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.75 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC2[3][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 2.0 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC2[4][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
print "AngularerrortwoC2: ", AngularerrortwoC2[0]
|
||||
print "AngularerrortwoC2: ", AngularerrortwoC2[1]
|
||||
print "AngularerrortwoC2: ", AngularerrortwoC2[2]
|
||||
print "AngularerrortwoC2: ", AngularerrortwoC2[3]
|
||||
print "AngularerrortwoC2: ", AngularerrortwoC2[4]
|
||||
|
||||
meantwoC2D1 = np.mean(AngularerrortwoC2[0])
|
||||
meantwoC2D2 = np.mean(AngularerrortwoC2[1])
|
||||
meantwoC2D3 = np.mean(AngularerrortwoC2[2])
|
||||
meantwoC2D4 = np.mean(AngularerrortwoC2[3])
|
||||
meantwoC2D5 = np.mean(AngularerrortwoC2[4])
|
||||
|
||||
stdtwoC2D1 = np.std(AngularerrortwoC2[0])
|
||||
stdtwoC2D2 = np.std(AngularerrortwoC2[1])
|
||||
stdtwoC2D3 = np.std(AngularerrortwoC2[2])
|
||||
stdtwoC2D4 = np.std(AngularerrortwoC2[3])
|
||||
stdtwoC2D5 = np.std(AngularerrortwoC2[4])
|
||||
|
||||
meantwoC2 = [meantwoC2D1,meantwoC2D2,meantwoC2D3,meantwoC2D4,meantwoC2D5]
|
||||
stdtwoC2 = [stdtwoC2D1,stdtwoC2D2,stdtwoC2D3,stdtwoC2D4,stdtwoC2D5]
|
||||
|
||||
# C3
|
||||
distance = 1.5
|
||||
i = 0
|
||||
while i < 14:
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.0 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC3[0][i] = Datatwo[i][j][2]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
print "i: ", i," j: ", j
|
||||
if Datatwo[i][j][1] == 1.25 and Datatwo[i][j][0] == distance:
|
||||
print Datatwo[i][j][7]
|
||||
AngularerrortwoC3[1][i] = Datatwo[i][j][2]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.5 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC3[2][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.75 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC3[3][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 2.0 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC3[4][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
print "AngularerrortwoC3: ", AngularerrortwoC3[0]
|
||||
print "AngularerrortwoC3: ", AngularerrortwoC3[1]
|
||||
print "AngularerrortwoC3: ", AngularerrortwoC3[2]
|
||||
print "AngularerrortwoC3: ", AngularerrortwoC3[3]
|
||||
print "AngularerrortwoC3: ", AngularerrortwoC3[4]
|
||||
|
||||
meantwoC3D1 = np.mean(AngularerrortwoC3[0])
|
||||
meantwoC3D2 = np.mean(AngularerrortwoC3[1])
|
||||
meantwoC3D3 = np.mean(AngularerrortwoC3[2])
|
||||
meantwoC3D4 = np.mean(AngularerrortwoC3[3])
|
||||
meantwoC3D5 = np.mean(AngularerrortwoC3[4])
|
||||
|
||||
stdtwoC3D1 = np.std(AngularerrortwoC3[0])
|
||||
stdtwoC3D2 = np.std(AngularerrortwoC3[1])
|
||||
stdtwoC3D3 = np.std(AngularerrortwoC3[2])
|
||||
stdtwoC3D4 = np.std(AngularerrortwoC3[3])
|
||||
stdtwoC3D5 = np.std(AngularerrortwoC3[4])
|
||||
|
||||
meantwoC3 = [meantwoC3D1,meantwoC3D2,meantwoC3D3,meantwoC3D4,meantwoC3D5]
|
||||
stdtwoC3 = [stdtwoC3D1,stdtwoC3D2,stdtwoC3D3,stdtwoC3D4,stdtwoC3D5]
|
||||
|
||||
# C4
|
||||
distance = 1.75
|
||||
i = 0
|
||||
while i < 14:
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.0 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC4[0][i] = Datatwo[i][j][2]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
print "i: ", i," j: ", j
|
||||
if Datatwo[i][j][1] == 1.25 and Datatwo[i][j][0] == distance:
|
||||
print Datatwo[i][j][7]
|
||||
AngularerrortwoC4[1][i] = Datatwo[i][j][2]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.5 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC4[2][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.75 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC4[3][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 2.0 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC4[4][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
print "AngularerrortwoC4: ", AngularerrortwoC4[0]
|
||||
print "AngularerrortwoC4: ", AngularerrortwoC4[1]
|
||||
print "AngularerrortwoC4: ", AngularerrortwoC4[2]
|
||||
print "AngularerrortwoC4: ", AngularerrortwoC4[3]
|
||||
print "AngularerrortwoC4: ", AngularerrortwoC4[4]
|
||||
|
||||
meantwoC4D1 = np.mean(AngularerrortwoC4[0])
|
||||
meantwoC4D2 = np.mean(AngularerrortwoC4[1])
|
||||
meantwoC4D3 = np.mean(AngularerrortwoC4[2])
|
||||
meantwoC4D4 = np.mean(AngularerrortwoC4[3])
|
||||
meantwoC4D5 = np.mean(AngularerrortwoC4[4])
|
||||
|
||||
stdtwoC4D1 = np.std(AngularerrortwoC4[0])
|
||||
stdtwoC4D2 = np.std(AngularerrortwoC4[1])
|
||||
stdtwoC4D3 = np.std(AngularerrortwoC4[2])
|
||||
stdtwoC4D4 = np.std(AngularerrortwoC4[3])
|
||||
stdtwoC4D5 = np.std(AngularerrortwoC4[4])
|
||||
|
||||
meantwoC4 = [meantwoC4D1,meantwoC4D2,meantwoC4D3,meantwoC4D4,meantwoC4D5]
|
||||
stdtwoC4 = [stdtwoC4D1,stdtwoC4D2,stdtwoC4D3,stdtwoC4D4,stdtwoC4D5]
|
||||
|
||||
# C5
|
||||
distance = 2.0
|
||||
i = 0
|
||||
while i < 14:
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.0 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC5[0][i] = Datatwo[i][j][2]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
print "i: ", i," j: ", j
|
||||
if Datatwo[i][j][1] == 1.25 and Datatwo[i][j][0] == distance:
|
||||
print Datatwo[i][j][7]
|
||||
AngularerrortwoC5[1][i] = Datatwo[i][j][2]
|
||||
break
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.5 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC5[2][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 1.75 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC5[3][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
j = 0
|
||||
while j < 25:
|
||||
if Datatwo[i][j][1] == 2.0 and Datatwo[i][j][0] == distance:
|
||||
AngularerrortwoC5[4][i] = Datatwo[i][j][2]
|
||||
j = 25
|
||||
else:
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
print "AngularerrortwoC5: ", AngularerrortwoC5[0]
|
||||
print "AngularerrortwoC5: ", AngularerrortwoC5[1]
|
||||
print "AngularerrortwoC5: ", AngularerrortwoC5[2]
|
||||
print "AngularerrortwoC5: ", AngularerrortwoC5[3]
|
||||
print "AngularerrortwoC5: ", AngularerrortwoC5[4]
|
||||
|
||||
meantwoC5D1 = np.mean(AngularerrortwoC5[0])
|
||||
meantwoC5D2 = np.mean(AngularerrortwoC5[1])
|
||||
meantwoC5D3 = np.mean(AngularerrortwoC5[2])
|
||||
meantwoC5D4 = np.mean(AngularerrortwoC5[3])
|
||||
meantwoC5D5 = np.mean(AngularerrortwoC5[4])
|
||||
|
||||
stdtwoC5D1 = np.std(AngularerrortwoC5[0])
|
||||
stdtwoC5D2 = np.std(AngularerrortwoC5[1])
|
||||
stdtwoC5D3 = np.std(AngularerrortwoC5[2])
|
||||
stdtwoC5D4 = np.std(AngularerrortwoC5[3])
|
||||
stdtwoC5D5 = np.std(AngularerrortwoC5[4])
|
||||
|
||||
meantwoC5 = [meantwoC5D1,meantwoC5D2,meantwoC5D3,meantwoC5D4,meantwoC5D5]
|
||||
stdtwoC5 = [stdtwoC5D1,stdtwoC5D2,stdtwoC5D3,stdtwoC5D4,stdtwoC5D5]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
######################################################################################
|
||||
|
||||
N = 5
|
||||
ind = np.asarray([0.25,1.25,2.25,3.25,4.25])
|
||||
|
||||
width = 0.5 # the width of the bars
|
||||
|
||||
x1 = [0.375,1.375,2.375,3.375,4.375]
|
||||
x2 = [0.425,1.425,2.425,3.425,4.425]
|
||||
x3 = [0.475,1.475,2.475,3.475,4.475]
|
||||
x4 = [0.525,1.525,2.525,3.525,4.525]
|
||||
x5 = [0.575,1.575,2.575,3.575,4.575]
|
||||
x6 = [0.625,1.625,2.625,3.625,4.625]
|
||||
|
||||
fig = plt.figure(figsize=(14.0, 10.0))
|
||||
|
||||
|
||||
|
||||
ax = fig.add_subplot(111)
|
||||
|
||||
|
||||
|
||||
# rects1 = ax.bar(ind, Participantmean,width, color='r',edgecolor='black',)#, hatch='//')
|
||||
rects1 = ax.errorbar(x1, meanC1,yerr=[stdC1,stdC1],fmt='o',color='blue',ecolor='blue',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x1, meanC1, marker="o", linestyle='-',lw=3,color='blue',label = r'2D-to-2D Calibration Depth 1')
|
||||
|
||||
# rects2 =ax.errorbar(x2, meanC2,yerr=[stdC2,stdC2],fmt='o',color='red',ecolor='red',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x2, meanC2, marker="o", linestyle='-',lw=3,color='red')
|
||||
|
||||
rects3 = ax.errorbar(x3, meanC3,yerr=[stdC3,stdC3],fmt='o',color='orange',ecolor='orange',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x3, meanC3, marker="o", linestyle='-',lw=3,color='orange',label = r'2D-to-2D Calibration Depth 3')
|
||||
#
|
||||
# rects4 =ax.errorbar(x4, meanC4,yerr=[stdC4,stdC4],fmt='o',color='green',ecolor='green',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x4, meanC4, marker="o", linestyle='-',lw=3,color='green')
|
||||
|
||||
rects5 =ax.errorbar(x5, meanC5,yerr=[stdC5,stdC5],fmt='o',color='red',ecolor='red',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x5, meanC5, marker="o", linestyle='-',lw=3,color='red',label = r'2D-to-2D Calibration Depth 5')
|
||||
|
||||
|
||||
|
||||
# rects1 = ax.bar(ind, Participantmean,width, color='r',edgecolor='black',)#, hatch='//')
|
||||
rects2 = ax.errorbar(x2, meantwoC1,yerr=[stdtwoC1,stdtwoC1],fmt='o',color='blue',ecolor='blue',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x2, meantwoC1, marker="o", linestyle='--',lw=3,color='blue',label = r'2D-to-3D Calibration Depth 1')
|
||||
|
||||
# rects2 =ax.errorbar(x2, meanC2,yerr=[stdC2,stdC2],fmt='o',color='red',ecolor='red',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x2, meanC2, marker="o", linestyle='-',lw=3,color='red')
|
||||
|
||||
rects4 = ax.errorbar(x4, meantwoC3,yerr=[stdtwoC3,stdtwoC3],fmt='o',color='orange',ecolor='orange',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x4, meantwoC3, marker="o", linestyle='--',lw=3,color='orange',label = r'2D-to-3D Calibration Depth 3')
|
||||
#
|
||||
# rects4 =ax.errorbar(x4, meanC4,yerr=[stdC4,stdC4],fmt='o',color='green',ecolor='green',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x4, meanC4, marker="o", linestyle='-',lw=3,color='green')
|
||||
|
||||
rects6 =ax.errorbar(x6, meantwoC5,yerr=[stdtwoC5,stdtwoC5],fmt='o',color='red',ecolor='red',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x6, meantwoC5, marker="o", linestyle='--',lw=3,color='red',label = r'2D-to-3D Calibration Depth 5')
|
||||
|
||||
|
||||
ax.set_ylabel('Angular Error',fontsize=22)
|
||||
ax.set_xlabel('Depth',fontsize=22)
|
||||
ax.set_xticks(ind+0.25)
|
||||
ax.set_xticklabels( ('D1', 'D2', 'D3','D4', 'D5') ,fontsize=16)
|
||||
|
||||
TOPICs = [0.0,0.5,1.5,2.5,3.5,4.5,5.0]#,110]#,120]
|
||||
print TOPICs
|
||||
LABELs = ["",r'D1 - 1m',r'D2 - 1.25m', r'D3 - 1.5m', r'D4 - 1.75m', r'D5 - 2.0m', ""]#, ""]#, ""]
|
||||
|
||||
# fig.canvas.set_window_title('Distance Error Correlation')
|
||||
plt.xticks(TOPICs, LABELs,fontsize=18)
|
||||
|
||||
# legend([rects1,rects2,rects3,rects4,rects5], [r'\LARGE\textbf{Calibration Distance 1}', r'\LARGE\textbf{Calibration Distance 2}',r'\LARGE\textbf{Calibration Distance 3}', r'\LARGE\textbf{Calibration Distance 4}',r'\LARGE\textbf{Calibration Distance 5}'], loc='lower right')
|
||||
legend(fontsize=20,loc='best')
|
||||
|
||||
TOPICS = [-4.0,-2.0, 0.0,2.0,4.0,6.0,8.0,10.0,12,14,16,18,20,22,24]#,110]#,120]
|
||||
print TOPICS
|
||||
LABELS = [r'', r'',r'0',r'2', r'4', r'6', r'8', r'10', r'12', r'14', r'16', r'18', r'20', r'22', r'24']#, ""]#, ""]
|
||||
|
||||
# fig.canvas.set_window_title('Accuracy - Activity Statistics')
|
||||
plt.yticks(TOPICS, LABELS,fontsize=18)
|
||||
|
||||
def autolabel(rects):
|
||||
# attach some text labels
|
||||
for rect in rects:
|
||||
height = rect.get_height()
|
||||
ax.text(0.26+rect.get_x()+rect.get_width()/2., height +0.35, "%.2f"%float(height),
|
||||
ha='center', va='bottom',fontweight='bold',fontsize=13.5)
|
||||
|
||||
# autolabel(rects1)
|
||||
|
||||
|
||||
left = 0.1 # the left side of the subplots of the figure
|
||||
right = 0.975 # the right side of the subplots of the figure
|
||||
bottom = 0.075 # the bottom of the subplots of the figure
|
||||
top = 0.925 # the top of the subplots of the figure
|
||||
wspace = 0.2 # the amount of width reserved for blank space between subplots
|
||||
hspace = 0.4 # the amount of height reserved for white space between subplots
|
||||
|
||||
plt.subplots_adjust(left=left, bottom=bottom, right=right, top=top, wspace=wspace, hspace=hspace)
|
||||
plt.show()
|
||||
|
||||
|
||||
means = [meanC1, meanC2, meanC3, meanC4, meanC5]
|
||||
print meanC1
|
||||
print meanC2
|
||||
print meanC3
|
||||
print meanC4
|
||||
print meanC5
|
||||
|
||||
fixationinfos_list_path = "MeansC1D2D2.npy"
|
||||
fixationinfos_list_csv_path = "MeansC1D2D2.csv"
|
||||
np.save(fixationinfos_list_path,np.asarray(means))
|
||||
np.savetxt(fixationinfos_list_csv_path,np.asarray(means), delimiter=",", fmt="%f")
|
||||
|
||||
## fixationinfos_list_path = "Activitymin_"+str(activity)+".npy"
|
||||
## fixationinfos_list_csv_path = "Activitymin_"+str(activity)+".csv"
|
||||
## np.save(fixationinfos_list_path,np.asarray(Activitymin))
|
||||
## np.savetxt(fixationinfos_list_csv_path,np.asarray(Activitymin), delimiter=",", fmt="%s")
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
|
1980
code/Visualization/3CalibrationDepths.py
Normal file
1980
code/Visualization/3CalibrationDepths.py
Normal file
File diff suppressed because it is too large
Load diff
200
code/Visualization/EffectDistanceDifference1CalibrationDepth.py
Normal file
200
code/Visualization/EffectDistanceDifference1CalibrationDepth.py
Normal file
|
@ -0,0 +1,200 @@
|
|||
import os, sys
|
||||
import seaborn
|
||||
from pylab import rcParams
|
||||
import cv2
|
||||
|
||||
import numpy as np
|
||||
from numpy import linalg as LA
|
||||
from time import time
|
||||
from itertools import combinations
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib.pyplot import *
|
||||
import matplotlib.patches as mpatches
|
||||
|
||||
# activate latex text rendering
|
||||
#rc('text', usetex=True)
|
||||
|
||||
def main(argv):
|
||||
# path = str(argv[0])
|
||||
# path ="/home/Julian/3D_Pupil_Project/work/results/2D2D/"
|
||||
|
||||
# Data1 = np.load(path + "p5_2d2d_all.npy")
|
||||
# Data2 = np.load(path + "p7_2d2d_all.npy")
|
||||
# Data3 = np.load(path + "p10_2d2d_all.npy")
|
||||
# Data4 = np.load(path + "p11_2d2d_all.npy")
|
||||
# Data5 = np.load(path + "p12_2d2d_all.npy")
|
||||
# Data6 = np.load(path + "p13_2d2d_all.npy")
|
||||
# Data7 = np.load(path + "p14_2d2d_all.npy")
|
||||
# Data8 = np.load(path + "p15_2d2d_all.npy")
|
||||
# Data9 = np.load(path + "p16_2d2d_all.npy")
|
||||
# Data10 = np.load(path + "p20_2d2d_all.npy")
|
||||
# Data11 = np.load(path + "p21_2d2d_all.npy")
|
||||
# Data12 = np.load(path + "p24_2d2d_all.npy")
|
||||
# Data13 = np.load(path + "p25_2d2d_all.npy")
|
||||
D2D2 = np.load("MeansC1D2D2.npy")
|
||||
D2D3 = np.load("MeansC1D2D3.npy")
|
||||
|
||||
|
||||
mean02D2D = np.mean([D2D2[0][0],D2D2[1][1], D2D2[2][2], D2D2[3][3], D2D2[4][4]])
|
||||
mean12D2D = np.mean([D2D2[0][1],D2D2[1][2], D2D2[2][3], D2D2[3][4]])
|
||||
mean22D2D = np.mean([D2D2[0][2],D2D2[1][3], D2D2[2][4]])
|
||||
mean32D2D = np.mean([D2D2[0][3],D2D2[1][4]])
|
||||
mean42D2D = np.mean([D2D2[0][4]])
|
||||
|
||||
# mean2D2D = [mean02D2D,mean12D2D,mean22D2D,mean32D2D,mean42D2D]
|
||||
|
||||
minmean02D2D = np.mean([D2D2[1][0],D2D2[2][1], D2D2[3][2], D2D2[4][3]])
|
||||
minmean12D2D = np.mean([D2D2[2][0],D2D2[3][1], D2D2[4][2]])
|
||||
minmean22D2D = np.mean([D2D2[3][0],D2D2[4][1]])
|
||||
minmean32D2D = np.mean([D2D2[4][0]])
|
||||
|
||||
# minmean2D2D = [minmean02D2D,minmean12D2D,minmean22D2D,minmean32D2D]
|
||||
|
||||
std02D2D = np.std([D2D2[0][0],D2D2[1][1], D2D2[2][2], D2D2[3][3], D2D2[4][4]])
|
||||
std12D2D = np.std([D2D2[0][1],D2D2[1][2], D2D2[2][3], D2D2[3][4]])
|
||||
std22D2D = np.std([D2D2[0][2],D2D2[1][3], D2D2[2][4]])
|
||||
std32D2D = np.std([D2D2[0][3],D2D2[1][4]])
|
||||
std42D2D = np.std([D2D2[0][4]])
|
||||
|
||||
# std2D2D = [std02D2D,std12D2D,std22D2D,std32D2D,std42D2D]
|
||||
|
||||
minstd02D2D = np.std([D2D2[1][0],D2D2[2][1], D2D2[3][2], D2D2[4][3]])
|
||||
minstd12D2D = np.std([D2D2[2][0],D2D2[3][1], D2D2[4][2]])
|
||||
minstd22D2D = np.std([D2D2[3][0],D2D2[4][1]])
|
||||
minstd32D2D = np.std([D2D2[4][0]])
|
||||
|
||||
# minstd2D2D = [minstd02D2D,minstd12D2D,minstd22D2D,minstd32D2D]
|
||||
|
||||
mean2D2D = [minmean32D2D,minmean22D2D,minmean12D2D,minmean02D2D,mean02D2D,mean12D2D,mean22D2D,mean32D2D,mean42D2D]
|
||||
std2D2D = [minstd32D2D,minstd22D2D,minstd12D2D,minstd02D2D,std02D2D,std12D2D,std22D2D,std32D2D,std42D2D]
|
||||
|
||||
mean02D3D = np.mean([D2D3[0][0],D2D3[1][1], D2D3[2][2], D2D3[3][3], D2D3[4][4]])
|
||||
mean12D3D = np.mean([D2D3[0][1],D2D3[1][2], D2D3[2][3], D2D3[3][4]])
|
||||
mean22D3D = np.mean([D2D3[0][2],D2D3[1][3], D2D3[2][4]])
|
||||
mean32D3D = np.mean([D2D3[0][3],D2D3[1][4]])
|
||||
mean42D3D = np.mean([D2D3[0][4]])
|
||||
|
||||
# mean2D3D = [mean02D3D,mean12D3D,mean22D3D,mean32D3D,mean42D3D]
|
||||
|
||||
std02D3D = np.std([D2D3[0][0],D2D3[1][1], D2D3[2][2], D2D3[3][3], D2D3[4][4]])
|
||||
std12D3D = np.std([D2D3[0][1],D2D3[1][2], D2D3[2][3], D2D3[3][4]])
|
||||
std22D3D = np.std([D2D3[0][2],D2D3[1][3], D2D3[2][4]])
|
||||
std32D3D = np.std([D2D3[0][3],D2D3[1][4]])
|
||||
std42D3D = np.std([D2D3[0][4]])
|
||||
|
||||
# std2D3D = [std02D3D,std12D3D,std22D3D,std32D3D,std42D3D]
|
||||
|
||||
minmean02D3D = np.mean([D2D3[1][0],D2D3[2][1], D2D3[3][2], D2D3[4][3]])
|
||||
minmean12D3D = np.mean([D2D3[2][0],D2D3[3][1], D2D3[4][2]])
|
||||
minmean22D3D = np.mean([D2D3[3][0],D2D3[4][1]])
|
||||
minmean32D3D = np.mean([D2D3[4][0]])
|
||||
|
||||
# minmean2D3D = [minmean02D3D,minmean12D3D,minmean22D3D,minmean32D3D]
|
||||
|
||||
minstd02D3D = np.std([D2D3[1][0],D2D3[2][1], D2D3[3][2], D2D3[4][3]])
|
||||
minstd12D3D = np.std([D2D3[2][0],D2D3[3][1], D2D3[4][2]])
|
||||
minstd22D3D = np.std([D2D3[3][0],D2D3[4][1]])
|
||||
minstd32D3D = np.std([D2D3[4][0]])
|
||||
|
||||
# minstd2D3D = [minstd02D3D,minstd12D3D,minstd22D3D,minstd32D3D]
|
||||
|
||||
mean2D3D = [minmean32D3D,minmean22D3D,minmean12D3D,minmean02D3D,mean02D3D,mean12D3D,mean22D3D,mean32D3D,mean42D3D]
|
||||
std2D3D = [minstd32D3D,minstd22D3D,minstd12D3D,minstd02D3D,std02D3D,std12D3D,std22D3D,std32D3D,std42D3D]
|
||||
|
||||
N = 5
|
||||
ind = np.asarray([0.25,1.25,2.25,3.25,4.25])
|
||||
|
||||
width = 0.5 # the width of the bars
|
||||
|
||||
# x1 = [0.4,1.4,2.4,3.4,4.4]
|
||||
x2 = [-3.55,-2.55,-1.55,-0.55,0.45,1.45,2.45,3.45,4.45]
|
||||
# x3 = [0.5,1.5,2.5,3.5,4.5]
|
||||
x4 = [-3.45,-2.45,-1.45,-0.45,0.55,1.55,2.55,3.55,4.55]
|
||||
# x5 = [0.6,1.6,2.6,3.6,4.6]
|
||||
|
||||
fig = plt.figure(figsize=(14.0, 10.0))
|
||||
|
||||
|
||||
|
||||
ax = fig.add_subplot(111)
|
||||
|
||||
# print mean2D2D
|
||||
# print mean2D3D
|
||||
|
||||
# ax.axhline(linewidth=2, y = np.mean(mean2D2D),color='r')
|
||||
# ax.axhline(linewidth=2, y = np.mean(mean2D3D),color='blue')
|
||||
|
||||
|
||||
# ax.axhline(linewidth=2, y = minvaluevalue,color='black')
|
||||
|
||||
# ax.text(0.98, Participantmeanvalue+0.5, "Mean %.2f" % Participantmeanvalue,fontsize=12, fontweight='bold',color='r')
|
||||
# ax.text(0.98, maxvaluevalue+0.5, "Maximum %.2f" % maxvaluevalue,fontsize=12, fontweight='bold',color='black')
|
||||
# ax.text(0.98, minvaluevalue+0.5, "Minimum %.2f" % minvaluevalue,fontsize=12, fontweight='bold', color='black')
|
||||
|
||||
# rects1 = ax.bar(ind, Participantmean,width, color='r',edgecolor='black',)#, hatch='//')
|
||||
rects1 = ax.errorbar(x2, mean2D2D,yerr=[std2D2D,std2D2D],fmt='o',color='red',ecolor='red',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x2, mean2D2D, marker="o", linestyle='-',lw=3,color='red',label = r'2D-to-2D')
|
||||
|
||||
rects2 =ax.errorbar(x4, mean2D3D,yerr=[std2D3D,std2D3D],fmt='o',color='blue',ecolor='blue',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x4, mean2D3D, marker="o", linestyle='-',lw=3,color='blue', label = r'2D-to-3D')
|
||||
|
||||
legend(fontsize=20,loc='upper right')
|
||||
|
||||
# rects3 = ax.errorbar(x3, meanC3,yerr=[stdC3,stdC3],fmt='o',color='black',ecolor='black',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x3, meanC3, marker="o", linestyle='-',lw=3,color='black')
|
||||
#
|
||||
# rects4 =ax.errorbar(x4, meanC4,yerr=[stdC4,stdC4],fmt='o',color='green',ecolor='green',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x4, meanC4, marker="o", linestyle='-',lw=3,color='green')
|
||||
#
|
||||
# rects5 =ax.errorbar(x5, meanC5,yerr=[stdC5,stdC5],fmt='o',color='orange',ecolor='orange',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x5, meanC5, marker="o", linestyle='-',lw=3,color='orange')
|
||||
|
||||
|
||||
ax.set_ylabel(r'Angular Error',fontsize=22)
|
||||
ax.set_xlabel(r'Distance Difference',fontsize=22)
|
||||
ax.set_xticks(ind+0.25)
|
||||
ax.set_xticklabels( ('D1', 'D2', 'D3','D4', 'D5') ,fontsize=18)
|
||||
|
||||
TOPICs = [-3.5,-2.5,-1.5,-0.5,0.5,1.5,2.5,3.5,4.5]#,110]#,120]
|
||||
print TOPICs
|
||||
LABELs = [r'-1m',r'-0.75m', r'-0.5m', r'-0.25m', r'0m',r'0.25m', r'0.5m', r'0.75m', r'1.0m', ""]#, ""]#, ""]
|
||||
|
||||
# fig.canvas.set_window_title('Distance Error Correlation')
|
||||
plt.xticks(TOPICs, LABELs,fontsize=18)
|
||||
|
||||
# legend([rects1,rects2], [r'\LARGE\textbf{2D2D}', r'\LARGE\textbf{2D3D}'], loc='lower right')
|
||||
|
||||
TOPICS = [0.5,1.0,1.5,2.0,2.5,3.0,3.5,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,8.5]#,110]#,120]
|
||||
print TOPICS
|
||||
LABELS = [r'0.5',r'1', r'1.5', r'2', r'2.5', r'3', r'3.5', r'4', r'4.5', r'5', r'5.5', r'6', r'6.5', r'7', r'7.5', r'8', r'8.5']#, ""]#, ""]
|
||||
|
||||
# fig.canvas.set_window_title('Accuracy - Activity Statistics')
|
||||
plt.yticks(TOPICS, LABELS,fontsize=18)
|
||||
|
||||
def autolabel(rects):
|
||||
# attach some text labels
|
||||
for rect in rects:
|
||||
height = rect.get_height()
|
||||
ax.text(0.26+rect.get_x()+rect.get_width()/2., height +0.35, "%.2f"%float(height),
|
||||
ha='center', va='bottom',fontweight='bold',fontsize=13.5)
|
||||
|
||||
# autolabel(rects1)
|
||||
|
||||
|
||||
left = 0.1 # the left side of the subplots of the figure
|
||||
right = 0.975 # the right side of the subplots of the figure
|
||||
bottom = 0.075 # the bottom of the subplots of the figure
|
||||
top = 0.925 # the top of the subplots of the figure
|
||||
wspace = 0.2 # the amount of width reserved for blank space between subplots
|
||||
hspace = 0.4 # the amount of height reserved for white space between subplots
|
||||
|
||||
plt.subplots_adjust(left=left, bottom=bottom, right=right, top=top, wspace=wspace, hspace=hspace)
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
|
350
code/Visualization/EffectNumberofClusters.py
Normal file
350
code/Visualization/EffectNumberofClusters.py
Normal file
|
@ -0,0 +1,350 @@
|
|||
import os, sys
|
||||
import seaborn
|
||||
from pylab import rcParams
|
||||
import cv2
|
||||
|
||||
import numpy as np
|
||||
from numpy import linalg as LA
|
||||
from time import time
|
||||
from itertools import combinations
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib.pyplot import *
|
||||
import matplotlib.patches as mpatches
|
||||
|
||||
# activate latex text rendering
|
||||
#rc('text', usetex=True)
|
||||
|
||||
def main(argv):
|
||||
|
||||
C12D2D = np.load("MeansC1D2D2.npy")
|
||||
C12D3D = np.load("MeansC1D2D3.npy")
|
||||
|
||||
C22D2D = np.load("MeansC2D2D2.npy")
|
||||
C22D3D = np.load("MeansC2D2D3.npy")
|
||||
|
||||
C32D2D = np.load("MeansC3D2D2.npy")
|
||||
C32D3D = np.load("MeansC3D2D3.npy")
|
||||
|
||||
C42D2D = np.load("MeansC4D2D2.npy")
|
||||
C42D3D = np.load("MeansC4D2D3.npy")
|
||||
|
||||
C52D2D = np.load("MeansC5D2D2.npy")
|
||||
C52D3D = np.load("MeansC5D2D3.npy")
|
||||
|
||||
|
||||
summeC12D2D = []
|
||||
summeC22D2D = []
|
||||
summeC32D2D = []
|
||||
summeC42D2D = []
|
||||
summeC52D2D = []
|
||||
|
||||
summeC12D3D = []
|
||||
summeC22D3D = []
|
||||
summeC32D3D = []
|
||||
summeC42D3D = []
|
||||
summeC52D3D = []
|
||||
|
||||
|
||||
i = 0
|
||||
while i < len(C12D2D):
|
||||
j = 0
|
||||
while j < len(C12D2D[0]):
|
||||
summeC12D2D.append(C12D2D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C22D2D):
|
||||
j = 0
|
||||
while j < len(C22D2D[0]):
|
||||
summeC22D2D.append(C22D2D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C32D2D):
|
||||
j = 0
|
||||
while j < len(C32D2D[0]):
|
||||
summeC32D2D.append(C32D2D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C42D2D):
|
||||
j = 0
|
||||
while j < len(C42D2D[0]):
|
||||
summeC42D2D.append(C42D2D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C52D2D):
|
||||
j = 0
|
||||
while j < len(C52D2D[0]):
|
||||
summeC52D2D.append(C52D2D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C12D3D):
|
||||
j = 0
|
||||
while j < len(C12D3D[0]):
|
||||
summeC12D3D.append(C12D3D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C22D3D):
|
||||
j = 0
|
||||
while j < len(C22D3D[0]):
|
||||
summeC22D3D.append(C22D3D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C32D3D):
|
||||
j = 0
|
||||
while j < len(C32D3D[0]):
|
||||
summeC32D3D.append(C32D3D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C42D3D):
|
||||
j = 0
|
||||
while j < len(C42D3D[0]):
|
||||
summeC42D3D.append(C42D3D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C52D3D):
|
||||
j = 0
|
||||
while j < len(C52D3D[0]):
|
||||
summeC52D3D.append(C52D3D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
|
||||
mean1 = np.mean(summeC12D2D)
|
||||
mean2 = np.mean(summeC22D2D)
|
||||
mean3 = np.mean(summeC32D2D)
|
||||
mean4 = np.mean(summeC42D2D)
|
||||
mean5 = np.mean(summeC52D2D)
|
||||
|
||||
mean6 = np.mean(summeC12D3D)
|
||||
mean7 = np.mean(summeC22D3D)
|
||||
mean8 = np.mean(summeC32D3D)
|
||||
mean9 = np.mean(summeC42D3D)
|
||||
mean10 = np.mean(summeC52D3D)
|
||||
|
||||
std1 = np.std(summeC12D2D)
|
||||
std2 = np.std(summeC22D2D)
|
||||
std3 = np.std(summeC32D2D)
|
||||
std4 = np.std(summeC42D2D)
|
||||
std5 = np.std(summeC52D2D)
|
||||
|
||||
std6 = np.std(summeC12D3D)
|
||||
std7 = np.std(summeC22D3D)
|
||||
std8 = np.std(summeC32D3D)
|
||||
std9 = np.std(summeC42D3D)
|
||||
std10 = np.std(summeC52D3D)
|
||||
|
||||
# i = 0
|
||||
# while i < len(C12D2D):
|
||||
# j = 0
|
||||
# while j < len(C12D2D[0]):
|
||||
# summeC12D2D.append(C12D2D[i][j])
|
||||
# j += 1
|
||||
# i += 1
|
||||
|
||||
|
||||
# print summeC12D2D
|
||||
|
||||
# i = 0
|
||||
# minimum2 = 100
|
||||
# while i < len(C22D2D):
|
||||
# print np.mean(C22D2D[i])
|
||||
# if np.mean(C22D2D[i]) < minimum2:
|
||||
# minimum2 = np.mean(C22D2D[i])
|
||||
# i += 1
|
||||
#
|
||||
# i = 0
|
||||
# minimum3 = 100
|
||||
# while i < len(C32D2D):
|
||||
# print np.mean(C32D2D[i])
|
||||
# if np.mean(C32D2D[i]) < minimum3:
|
||||
# minimum3 = np.mean(C32D2D[i])
|
||||
# i += 1
|
||||
#
|
||||
# i = 0
|
||||
# minimum4 = 100
|
||||
# while i < len(C42D2D):
|
||||
# print np.mean(C42D2D[i])
|
||||
# if np.mean(C42D2D[i]) < minimum4:
|
||||
# minimum4 = np.mean(C42D2D[i])
|
||||
# i += 1
|
||||
#
|
||||
# i = 0
|
||||
# minimum5 = 100
|
||||
# while i < len(C52D2D):
|
||||
# print np.mean(C52D2D[i])
|
||||
# if np.mean(C52D2D[i]) < minimum5:
|
||||
# minimum5 = np.mean(C52D2D[i])
|
||||
# i += 1
|
||||
#
|
||||
# i = 0
|
||||
# minimum6 = 100
|
||||
# while i < len(C12D3D):
|
||||
# print np.mean(C12D3D[i])
|
||||
# if np.mean(C12D3D[i]) < minimum6:
|
||||
# minimum6 = np.mean(C12D3D[i])
|
||||
# i += 1
|
||||
#
|
||||
# i = 0
|
||||
# minimum7 = 100
|
||||
# while i < len(C22D3D):
|
||||
# print np.mean(C22D3D[i])
|
||||
# if np.mean(C22D3D[i]) < minimum7:
|
||||
# minimum7 = np.mean(C22D3D[i])
|
||||
# i += 1
|
||||
#
|
||||
# i = 0
|
||||
# minimum8 = 100
|
||||
# while i < len(C32D3D):
|
||||
# print np.mean(C32D3D[i])
|
||||
# if np.mean(C32D3D[i]) < minimum8:
|
||||
# minimum8 = np.mean(C32D3D[i])
|
||||
# i += 1
|
||||
#
|
||||
# i = 0
|
||||
# minimum9 = 100
|
||||
# while i < len(C42D3D):
|
||||
# print np.mean(C42D3D[i])
|
||||
# if np.mean(C42D3D[i]) < minimum9:
|
||||
# minimum9 = np.mean(C42D3D[i])
|
||||
# i += 1
|
||||
|
||||
# i = 0
|
||||
# minimum10 = 100
|
||||
# while i < len(C52D3D):
|
||||
# print np.mean(C52D3D[i])
|
||||
# if np.mean(C52D3D[i]) < minimum10:
|
||||
# minimum10 = np.mean(C52D3D[i])
|
||||
# i += 1
|
||||
#
|
||||
mean2D2D = [mean1,mean2,mean3,mean4,mean5]
|
||||
mean2D3D = [mean6,mean7,mean8,mean9,mean10]
|
||||
|
||||
std2D2D = [std1,std2,std3,std4,std5]
|
||||
std2D3D = [std6,std7,std8,std9,std10]
|
||||
|
||||
# print minimum1
|
||||
|
||||
# i = 0
|
||||
# minimum2 = 100
|
||||
# while i < 5:
|
||||
# if np.mean(C12D2D[i]) < minimum:
|
||||
# minimum1 = np.mean(C12D2D[i])
|
||||
# i += 1
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
N = 5
|
||||
ind = np.asarray([0.25,1.25,2.25,3.25,4.25])
|
||||
|
||||
width = 0.5 # the width of the bars
|
||||
|
||||
# x1 = [0.4,1.4,2.4,3.4,4.4]
|
||||
x2 = [0.45,1.45,2.45,3.45,4.45]
|
||||
# x3 = [0.5,1.5,2.5,3.5,4.5]
|
||||
x4 = [0.55,1.55,2.55,3.55,4.55]
|
||||
# x5 = [0.6,1.6,2.6,3.6,4.6]
|
||||
|
||||
fig = plt.figure(figsize=(14.0, 10.0))
|
||||
|
||||
|
||||
|
||||
ax = fig.add_subplot(111)
|
||||
|
||||
# print mean2D2D
|
||||
# print mean2D3D
|
||||
|
||||
# ax.axhline(linewidth=2, y = np.mean(mean2D2D),color='r')
|
||||
# ax.axhline(linewidth=2, y = np.mean(mean2D3D),color='blue')
|
||||
|
||||
# ax.axhline(linewidth=2, y = minvaluevalue,color='black')
|
||||
|
||||
# ax.text(0.98, Participantmeanvalue+0.5, "Mean %.2f" % Participantmeanvalue,fontsize=12, fontweight='bold',color='r')
|
||||
# ax.text(0.98, maxvaluevalue+0.5, "Maximum %.2f" % maxvaluevalue,fontsize=12, fontweight='bold',color='black')
|
||||
# ax.text(0.98, minvaluevalue+0.5, "Minimum %.2f" % minvaluevalue,fontsize=12, fontweight='bold', color='black')
|
||||
|
||||
# rects1 = ax.bar(ind, Participantmean,width, color='r',edgecolor='black',)#, hatch='//')
|
||||
rects1 = ax.errorbar(x2, mean2D2D,yerr=[std2D2D,std2D2D],fmt='o',color='red',ecolor='red',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x2, mean2D2D, marker="o", linestyle='-',lw=3,color='red',label = r'2D-to-2D')
|
||||
|
||||
rects2 =ax.errorbar(x4, mean2D3D,yerr=[std2D3D,std2D3D],fmt='o',color='blue',ecolor='blue',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x4, mean2D3D, marker="o", linestyle='-',lw=3,color='blue', label = r'2D-to-3D')
|
||||
|
||||
legend(fontsize=20,loc='upper right')
|
||||
|
||||
# rects3 = ax.errorbar(x3, meanC3,yerr=[stdC3,stdC3],fmt='o',color='black',ecolor='black',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x3, meanC3, marker="o", linestyle='-',lw=3,color='black')
|
||||
#
|
||||
# rects4 =ax.errorbar(x4, meanC4,yerr=[stdC4,stdC4],fmt='o',color='green',ecolor='green',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x4, meanC4, marker="o", linestyle='-',lw=3,color='green')
|
||||
#
|
||||
# rects5 =ax.errorbar(x5, meanC5,yerr=[stdC5,stdC5],fmt='o',color='orange',ecolor='orange',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x5, meanC5, marker="o", linestyle='-',lw=3,color='orange')
|
||||
|
||||
|
||||
ax.set_ylabel(r'Angular Error',fontsize=22)
|
||||
ax.set_xlabel(r'Number of Calibration Depths',fontsize=22)
|
||||
ax.set_xticks(ind+0.25)
|
||||
ax.set_xticklabels( ('D1', 'D2', 'D3','D4', 'D5') ,fontsize=18)
|
||||
|
||||
TOPICs = [0.0,0.5,1.5,2.5,3.5,4.5,5.0]#,110]#,120]
|
||||
print TOPICs
|
||||
LABELs = ["",r'1',r'2', r'3', r'4', r'5', ""]#, ""]#, ""]
|
||||
|
||||
# fig.canvas.set_window_title('Distance Error Correlation')
|
||||
plt.xticks(TOPICs, LABELs,fontsize=18)
|
||||
|
||||
# legend([rects1,rects2], [r'\LARGE\textbf{2D2D}', r'\LARGE\textbf{2D3D}'], loc='lower right')
|
||||
|
||||
TOPICS = [0.5,1,1.5,2,2.5,3,3.5,4,4.5,5]#,110]#,120]
|
||||
print TOPICS
|
||||
LABELS = [r'0.5', r'1',r'1.5', r'2',r'2.5', r'3',r'3.5', r'4',r'4.5',r'5']#, ""]#, ""]
|
||||
|
||||
# fig.canvas.set_window_title('Accuracy - Activity Statistics')
|
||||
plt.yticks(TOPICS, LABELS,fontsize=18)
|
||||
|
||||
def autolabel(rects):
|
||||
# attach some text labels
|
||||
for rect in rects:
|
||||
height = rect.get_height()
|
||||
ax.text(0.26+rect.get_x()+rect.get_width()/2., height +0.35, "%.2f"%float(height),
|
||||
ha='center', va='bottom',fontweight='bold',fontsize=13.5)
|
||||
|
||||
# autolabel(rects1)
|
||||
|
||||
|
||||
left = 0.1 # the left side of the subplots of the figure
|
||||
right = 0.975 # the right side of the subplots of the figure
|
||||
bottom = 0.075 # the bottom of the subplots of the figure
|
||||
top = 0.925 # the top of the subplots of the figure
|
||||
wspace = 0.2 # the amount of width reserved for blank space between subplots
|
||||
hspace = 0.4 # the amount of height reserved for white space between subplots
|
||||
|
||||
plt.subplots_adjust(left=left, bottom=bottom, right=right, top=top, wspace=wspace, hspace=hspace)
|
||||
plt.show()
|
||||
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main(sys.argv[1:])
|
||||
|
418
code/Visualization/EffectNumberofClusters_plus_Simulation.py
Normal file
418
code/Visualization/EffectNumberofClusters_plus_Simulation.py
Normal file
|
@ -0,0 +1,418 @@
|
|||
from __future__ import division
|
||||
|
||||
import os, sys
|
||||
import seaborn
|
||||
from pylab import rcParams
|
||||
import cv2
|
||||
|
||||
import numpy as np
|
||||
from numpy import linalg as LA
|
||||
from time import time
|
||||
from itertools import combinations
|
||||
|
||||
import matplotlib.pyplot as plt
|
||||
from matplotlib.pyplot import *
|
||||
import matplotlib.patches as mpatches
|
||||
|
||||
sys.path.append('..') # so we can import modules from `code` directory
|
||||
from minimize import findInitialW, _q, g, minimizeEnergy, g3D3D, findW3D3D
|
||||
from minimize import g as gaze_ray
|
||||
from geom import getSphericalCoords, getAngularDiff
|
||||
from vector import Vector as v
|
||||
|
||||
from sim import GazeSimulation
|
||||
from recording.util.tools import is_outlier
|
||||
from recording.tracker import readCameraParams
|
||||
from geom import getRotationMatrix
|
||||
from parallax_analysis import Experiment
|
||||
|
||||
'''
|
||||
Change lines 48 to 61 accordingly
|
||||
'''
|
||||
|
||||
|
||||
class Parallax2Dto3DMapping(Experiment):
|
||||
'''
|
||||
IMPORTANT!
|
||||
In all experiments, scene camera's rvec = (0, 0, 0) i.e. the corresponding rotation matrix is the identity matrix therefore
|
||||
I have not included the dot production with this rotation matrix to convert points in world coordinates
|
||||
into scene camera coordinates. however, one should know that if the scene camera is rotated differentl7y
|
||||
this transformation is essential. I would add the corresponding computations later on.
|
||||
'''
|
||||
|
||||
def __run__(self):
|
||||
# Processing real world data
|
||||
######################################################################################################
|
||||
print '> Processing real world data...'
|
||||
|
||||
C12D2D = np.load("../results/MeansC1D2D2.npy")
|
||||
C12D3D = np.load("../results/MeansC1D2D3.npy")
|
||||
|
||||
C22D2D = np.load("../results/MeansC2D2D2.npy")
|
||||
C22D3D = np.load("../results/MeansC2D2D3.npy")
|
||||
|
||||
C32D2D = np.load("../results/MeansC3D2D2.npy")
|
||||
C32D3D = np.load("../results/MeansC3D2D3.npy")
|
||||
|
||||
C42D2D = np.load("../results/MeansC4D2D2.npy")
|
||||
C42D3D = np.load("../results/MeansC4D2D3.npy")
|
||||
|
||||
C52D2D = np.load("../results/MeansC5D2D2.npy")
|
||||
C52D3D = np.load("../results/MeansC5D2D3.npy")
|
||||
|
||||
|
||||
summeC12D2D = []
|
||||
summeC22D2D = []
|
||||
summeC32D2D = []
|
||||
summeC42D2D = []
|
||||
summeC52D2D = []
|
||||
|
||||
summeC12D3D = []
|
||||
summeC22D3D = []
|
||||
summeC32D3D = []
|
||||
summeC42D3D = []
|
||||
summeC52D3D = []
|
||||
|
||||
|
||||
i = 0
|
||||
while i < len(C12D2D):
|
||||
j = 0
|
||||
while j < len(C12D2D[0]):
|
||||
summeC12D2D.append(C12D2D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C22D2D):
|
||||
j = 0
|
||||
while j < len(C22D2D[0]):
|
||||
summeC22D2D.append(C22D2D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C32D2D):
|
||||
j = 0
|
||||
while j < len(C32D2D[0]):
|
||||
summeC32D2D.append(C32D2D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C42D2D):
|
||||
j = 0
|
||||
while j < len(C42D2D[0]):
|
||||
summeC42D2D.append(C42D2D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C52D2D):
|
||||
j = 0
|
||||
while j < len(C52D2D[0]):
|
||||
summeC52D2D.append(C52D2D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C12D3D):
|
||||
j = 0
|
||||
while j < len(C12D3D[0]):
|
||||
summeC12D3D.append(C12D3D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C22D3D):
|
||||
j = 0
|
||||
while j < len(C22D3D[0]):
|
||||
summeC22D3D.append(C22D3D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C32D3D):
|
||||
j = 0
|
||||
while j < len(C32D3D[0]):
|
||||
summeC32D3D.append(C32D3D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C42D3D):
|
||||
j = 0
|
||||
while j < len(C42D3D[0]):
|
||||
summeC42D3D.append(C42D3D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
i = 0
|
||||
while i < len(C52D3D):
|
||||
j = 0
|
||||
while j < len(C52D3D[0]):
|
||||
summeC52D3D.append(C52D3D[i][j])
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
|
||||
mean1 = np.mean(summeC12D2D)
|
||||
mean2 = np.mean(summeC22D2D)
|
||||
mean3 = np.mean(summeC32D2D)
|
||||
mean4 = np.mean(summeC42D2D)
|
||||
mean5 = np.mean(summeC52D2D)
|
||||
|
||||
mean6 = np.mean(summeC12D3D)
|
||||
mean7 = np.mean(summeC22D3D)
|
||||
mean8 = np.mean(summeC32D3D)
|
||||
mean9 = np.mean(summeC42D3D)
|
||||
mean10 = np.mean(summeC52D3D)
|
||||
|
||||
std1 = np.std(summeC12D2D)
|
||||
std2 = np.std(summeC22D2D)
|
||||
std3 = np.std(summeC32D2D)
|
||||
std4 = np.std(summeC42D2D)
|
||||
std5 = np.std(summeC52D2D)
|
||||
|
||||
std6 = np.std(summeC12D3D)
|
||||
std7 = np.std(summeC22D3D)
|
||||
std8 = np.std(summeC32D3D)
|
||||
std9 = np.std(summeC42D3D)
|
||||
std10 = np.std(summeC52D3D)
|
||||
|
||||
mean2D2D_real = [mean1,mean2,mean3,mean4,mean5]
|
||||
mean2D3D_real = [mean6,mean7,mean8,mean9,mean10]
|
||||
|
||||
std2D2D_real = [std1,std2,std3,std4,std5]
|
||||
std2D3D_real = [std6,std7,std8,std9,std10]
|
||||
######################################################################################################
|
||||
# Simulation
|
||||
print '> Processing simulation data...'
|
||||
######################################################################################################
|
||||
sim = GazeSimulation(log = False)
|
||||
|
||||
sim.place_eyeball_on_scene_camera = False
|
||||
sim.setEyeRelativeToSceneCamera(v(-65, -33, -73))
|
||||
# sim.setEyeRelativeToSceneCamera(v(-65, -33, 0)) # assuming eyeball and scene camera are coplanar i.e. e = (e.x, e.y, 0)
|
||||
|
||||
sim.setCalibrationDepth(1 * 1000) # mm, wrt scene camera
|
||||
sim.setTestDepth(1.5 * 1000)
|
||||
sim.calibration_grid = True
|
||||
sim.calibration_random_depth = False
|
||||
sim.test_grid = True
|
||||
sim.test_random_depth = False
|
||||
sim.test_random_fixed_depth = False
|
||||
|
||||
depths = map(lambda d:d*1000, [1, 1.25, 1.5, 1.75, 2.0])
|
||||
print '> Computing results for multiple calibration depths...'
|
||||
results, results_std = [], []
|
||||
for num_of_calibration_depths in xrange(1, 6): # from 1 calibration depths to 5
|
||||
print '> Considering only %s calibration depth(s)...' %num_of_calibration_depths
|
||||
sim.reset()
|
||||
aae_2ds_aae = []
|
||||
aae_2ds_phe = []
|
||||
aae_3ds_aae = []
|
||||
aae_3ds_phe = []
|
||||
aae_3D3Ds = [] # angular error
|
||||
|
||||
for calibs in combinations(depths, num_of_calibration_depths):
|
||||
# Now calibs is a set of depths from each of which we need calibration data
|
||||
print '> Current calibration depths', calibs
|
||||
calibs = list(calibs)
|
||||
cp, ct = [], []
|
||||
sim.reset()
|
||||
sim.setCalibrationDepth(calibs)
|
||||
# Perform calibration
|
||||
sim.runCalibration()
|
||||
cp, ct, p3d = sim.tr_pupil_locations, sim.calibration_points, sim.tr_3d_pupil_locations
|
||||
# target positions are computed relative to the scene CCS
|
||||
ti = map(lambda target: v(target) - v(sim.scene_camera.t), ct)
|
||||
# Computing pupil pose for each gaze
|
||||
ni = map(lambda p: (v(p)-v(sim.sclera_pos)).norm(), p3d) # ground truth gaze vectors
|
||||
|
||||
w, e, w0 = minimizeEnergy(cp, ti)
|
||||
e = v(e)
|
||||
|
||||
# transforming pupil pose to eye camera CS
|
||||
eyeR = np.array(sim.eye_camera.R[:3])
|
||||
ni = map(lambda pose: eyeR.dot(np.array(pose)), ni)
|
||||
|
||||
R, e3d3d = minimizeEnergy(ni, ti, pose_given=True)
|
||||
e3d3d = v(e3d3d)
|
||||
# R = LA.inv(R)
|
||||
|
||||
# Now we have calibration data from multiple depths, we can test on all depths
|
||||
for test_depth in depths:
|
||||
sim.setTestDepth(test_depth)
|
||||
aae_2d_aae, aae_2d_phe, aae_2d_std, _ = sim.runTest() # last one is PHE std
|
||||
aae_2ds_aae.append((aae_2d_aae, aae_2d_std))
|
||||
aae_2ds_phe.append(aae_2d_phe)
|
||||
# Fetching test points
|
||||
t, p, p3d = sim.test_points, sim.te_pupil_locations, sim.te_3d_pupil_locations
|
||||
t = map(lambda target: v(target) - v(sim.scene_camera.t), t) # target coords in scene CCS
|
||||
|
||||
# 3D3D
|
||||
t_3d3d = t[:]
|
||||
|
||||
ni = map(lambda p: v(v(p)-v(sim.sclera_pos)).norm(), p3d) # ground truth gaze vectors
|
||||
# transforming pupil pose to eye camera CS
|
||||
ni = map(lambda r: v(eyeR.dot(np.array(r))), ni)
|
||||
|
||||
# applying estimated rotation to pose vector in eye camera coordinates (Rn)
|
||||
# R is estimated rotation between scene camera and eye coordinate system (not eye camera!)
|
||||
# in other words, R is the rotation part of e
|
||||
Rni = map(lambda n: v(R.dot(np.array(n))), ni) # now ready to compare Rn with t-e
|
||||
# Intersecting gaze rays originating from the eye with the planes defined by each
|
||||
# target. then we can simply compute angular error between each intersection and
|
||||
# the corresponding 3D target
|
||||
gis = map(lambda vec: v(vec), Rni) # gaze rays originating from eyeball
|
||||
# we multiply g such that it hits t's z-plane i.e. multiply all coordinates by factor (t.z-e.z)/g.z
|
||||
# then we add e to the final g so that it originates from scene camera. now both g and t are in the
|
||||
# same coordinate system and originate from the same point, so we can compare them
|
||||
gprimes = map(lambda tg: v(((tg[0].z - e3d3d.z)/tg[1].z)*tg[1] + e3d3d), zip(t_3d3d, gis))
|
||||
AE = list(np.degrees(np.arctan((v(p[0]).cross(p[1])/(v(p[0]).dot(p[1]))).mag)) for p in zip(gprimes, t_3d3d))
|
||||
|
||||
N = len(t)
|
||||
AAE = np.mean(AE)
|
||||
STD = np.std(AE)
|
||||
m, M = min(AE), max(AE)
|
||||
aae_3D3Ds.append((AAE, STD))
|
||||
|
||||
|
||||
qi = map(_q, p) # computing feature vectors from raw pupil coordinates in 2D
|
||||
# computing unit gaze vectors corresponding to pupil positions
|
||||
# here we use the computed mapping matrix w
|
||||
gis = map(lambda q: g(q, w), qi)
|
||||
|
||||
# Intersecting gaze rays originating from the eye with the planes defined by each
|
||||
# target. then we can simply compute angular error between each intersection and
|
||||
# the corresponding 3D target
|
||||
t = map(lambda vec: v(vec), t)
|
||||
gis = map(lambda vec: v(vec), gis)
|
||||
gprimes = map(lambda tg: v(((tg[0].z - e.z)/tg[1].z)*tg[1] + e), zip(t, gis))
|
||||
|
||||
AE = list(np.degrees(np.arctan((v(p[0]).cross(p[1])/(v(p[0]).dot(p[1]))).mag)) for p in zip(gprimes, t))
|
||||
N = len(t)
|
||||
AAE = np.mean(AE)
|
||||
STD = np.std(AE)
|
||||
m, M = min(AE), max(AE)
|
||||
|
||||
# Computing physical distance error (in meters)
|
||||
PHE = list((u-v).mag/1000 for u,v in zip(t, gprimes))
|
||||
N = len(t)
|
||||
APHE = np.mean(PHE)
|
||||
PHE_STD = np.std(PHE)
|
||||
PHE_m, PHE_M = min(PHE), max(PHE)
|
||||
|
||||
aae_3ds_aae.append((AAE, STD))
|
||||
aae_3ds_phe.append((PHE, PHE_STD))
|
||||
|
||||
# results only contains AAE
|
||||
results.append([np.mean(np.array(aae_2ds_aae)[:,0]), np.mean(np.array(aae_3ds_aae)[:,0]), np.mean(np.array(aae_3D3Ds)[:,0])])
|
||||
results_std.append([np.std(np.array(aae_2ds_aae)[:,0]), np.std(np.array(aae_3ds_aae)[:,0]), np.std(np.array(aae_3D3Ds)[:,0])])
|
||||
######################################################################################################
|
||||
# Plotting
|
||||
print '> Plotting...'
|
||||
######################################################################################################
|
||||
# New plot code based on EffectNumberofClusters.py
|
||||
mean2D2D = [res[0] for res in results]
|
||||
mean2D3D = [res[1] for res in results]
|
||||
mean3D3D = [res[2] for res in results]
|
||||
std2D2D = [res[0] for res in results_std]
|
||||
std2D3D = [res[1] for res in results_std]
|
||||
std3D3D = [res[2] for res in results_std]
|
||||
|
||||
|
||||
N = 5
|
||||
ind = np.asarray([0.25,1.25,2.25,3.25,4.25])
|
||||
|
||||
width = 0.5 # the width of the bars
|
||||
|
||||
# x1 = [0.4,1.4,2.4,3.4,4.4]
|
||||
x2 = [0.45,1.45,2.45,3.45,4.45]
|
||||
# x3 = [0.5,1.5,2.5,3.5,4.5]
|
||||
x4 = [0.55,1.55,2.55,3.55,4.55]
|
||||
# x5 = [0.6,1.6,2.6,3.6,4.6]
|
||||
x6 = [0.50,1.50,2.50,3.50,4.50]
|
||||
|
||||
fig = plt.figure(figsize=(14.0, 10.0))
|
||||
|
||||
ax = fig.add_subplot(111)
|
||||
|
||||
rrects1 = ax.errorbar(x2, mean2D2D_real,yerr=[std2D2D_real,std2D2D_real],fmt='o',color='red',ecolor='red',lw=3, capsize=8, capthick=3)
|
||||
plt.plot(x2, mean2D2D_real, marker="o", linestyle='-',lw=3,color='red',label = r'2D-to-2D')
|
||||
|
||||
rrects2 =ax.errorbar(x4, mean2D3D_real,yerr=[std2D3D_real,std2D3D_real],fmt='o',color='blue',ecolor='blue',lw=3, capsize=8, capthick=3)
|
||||
plt.plot(x4, mean2D3D_real, marker="o", linestyle='-',lw=3,color='blue', label = r'2D-to-3D')
|
||||
|
||||
|
||||
rects1 = ax.errorbar(x2, mean2D2D,yerr=[std2D2D,std2D2D],fmt='o',color='red',ecolor='red',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x2, mean2D2D, marker="o", linestyle='--',lw=3,color='red',label = r'2D-to-2D Simulation')
|
||||
|
||||
rects2 =ax.errorbar(x4, mean2D3D,yerr=[std2D3D,std2D3D],fmt='o',color='blue',ecolor='blue',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x4, mean2D3D, marker="o", linestyle='--',lw=3,color='blue', label = r'2D-to-3D Simulation')
|
||||
|
||||
rects3 =ax.errorbar(x6, mean3D3D,yerr=[std3D3D,std3D3D],fmt='o',color='orange',ecolor='orange',lw=3, capsize=5, capthick=2)
|
||||
plt.plot(x6, mean3D3D, marker="o", linestyle='--',lw=3,color='orange', label = r'3D-to-3D Simulation')
|
||||
|
||||
legend(fontsize=20,loc='upper right')
|
||||
|
||||
# rects3 = ax.errorbar(x3, meanC3,yerr=[stdC3,stdC3],fmt='o',color='black',ecolor='black',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x3, meanC3, marker="o", linestyle='-',lw=3,color='black')
|
||||
#
|
||||
# rects4 =ax.errorbar(x4, meanC4,yerr=[stdC4,stdC4],fmt='o',color='green',ecolor='green',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x4, meanC4, marker="o", linestyle='-',lw=3,color='green')
|
||||
#
|
||||
# rects5 =ax.errorbar(x5, meanC5,yerr=[stdC5,stdC5],fmt='o',color='orange',ecolor='orange',lw=3, capsize=5, capthick=2)
|
||||
# plt.plot(x5, meanC5, marker="o", linestyle='-',lw=3,color='orange')
|
||||
|
||||
|
||||
ax.set_ylabel(r'Angular Error',fontsize=22)
|
||||
ax.set_xlabel(r'Number of Calibration Depths',fontsize=22)
|
||||
ax.set_xticks(ind+0.25)
|
||||
ax.set_xticklabels( ('D1', 'D2', 'D3','D4', 'D5') ,fontsize=18)
|
||||
|
||||
TOPICs = [0.0,0.5,1.5,2.5,3.5,4.5,5.0]#,110]#,120]
|
||||
print TOPICs
|
||||
LABELs = ["",r'1',r'2', r'3', r'4', r'5', ""]#, ""]#, ""]
|
||||
|
||||
# fig.canvas.set_window_title('Distance Error Correlation')
|
||||
plt.xticks(TOPICs, LABELs,fontsize=18)
|
||||
|
||||
# legend([rects1,rects2], [r'\LARGE\textbf{2D2D}', r'\LARGE\textbf{2D3D}'], loc='lower right')
|
||||
|
||||
TOPICS = [0.0, 0.5,1,1.5,2,2.5,3,3.5,4,4.5,5]#,110]#,120]
|
||||
print TOPICS
|
||||
LABELS = [r'0.0', r'0.5', r'1',r'1.5', r'2',r'2.5', r'3',r'3.5', r'4',r'4.5',r'5']#, ""]#, ""]
|
||||
|
||||
# fig.canvas.set_window_title('Accuracy - Activity Statistics')
|
||||
plt.yticks(TOPICS, LABELS,fontsize=18)
|
||||
|
||||
def autolabel(rects):
|
||||
# attach some text labels
|
||||
for rect in rects:
|
||||
height = rect.get_height()
|
||||
ax.text(0.26+rect.get_x()+rect.get_width()/2., height +0.35, "%.2f"%float(height),
|
||||
ha='center', va='bottom',fontweight='bold',fontsize=13.5)
|
||||
|
||||
# autolabel(rects1)
|
||||
|
||||
|
||||
left = 0.1 # the left side of the subplots of the figure
|
||||
right = 0.975 # the right side of the subplots of the figure
|
||||
bottom = 0.075 # the bottom of the subplots of the figure
|
||||
top = 0.925 # the top of the subplots of the figure
|
||||
wspace = 0.2 # the amount of width reserved for blank space between subplots
|
||||
hspace = 0.4 # the amount of height reserved for white space between subplots
|
||||
|
||||
plt.subplots_adjust(left=left, bottom=bottom, right=right, top=top, wspace=wspace, hspace=hspace)
|
||||
plt.show()
|
||||
######################################################################################################
|
||||
|
||||
|
||||
def main():
|
||||
ex = Parallax2Dto3DMapping()
|
||||
ex.performExperiment()
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue