import numpy as np
import os
import matplotlib.pyplot as plt
dir = "..\\noise\\3.15\\"
lFile = os.listdir(dir)
def LoadData(path):
f = open(path)
center = []
LeftUp = []
LeftDown = []
RightUp = []
RightDown = []
for str in f.readlines():
if str.find('FN:0314Depth center') != -1:
list = str.split()
if list[-1] != '0':
center.append(list[-1])
if str.find('FN:0314Depth LeftUp') != -1:
list = str.split()
if list[-1] != '0':
LeftUp.append(list[-1])
if str.find('FN:0314Depth LeftDown') != -1:
list = str.split()
if list[-1] != '0':
LeftDown.append(list[-1])
if str.find('FN:0314Depth RightUp') != -1:
list = str.split()
if list[-1] != '0':
RightUp.append(list[-1])
if str.find('FN:0314Depth RightDown') != -1:
list = str.split()
if list[-1] != '0':
RightDown.append(list[-1])
f.close()
return center, LeftUp, LeftDown, RightUp, RightDown
if __name__ == '__main__':
for FileName in lFile:
print (FileName)
path = os.path.join(dir, FileName)
lcenter, lLeftUp, lLeftDown, lRightUp, lRightDown = LoadData(path)
arrCenter = np.array(lcenter,dtype='float32')
arrLeftUp = np.array(lLeftUp, dtype='float32')
arrLeftDown = np.array(lLeftDown, dtype='float32')
arrRightUp = np.array(lRightUp, dtype='float32')
arrRightDown = np.array(lRightDown, dtype='float32')
print ("center std , per, aver : ", arrCenter.std(), arrCenter.std()/np.average(arrCenter)*100, np.average(arrCenter))
print("LeftUp std , per, aver : ", arrLeftUp.std(), arrLeftUp.std()/np.average(arrLeftUp)*100, np.average(arrLeftUp))
print("LeftDown std , per, aver : ", arrLeftDown.std(), arrLeftDown.std()/np.average(arrLeftDown)*100, np.average(arrLeftDown))
print("RightUp std , per, aver : ", arrRightUp.std(), arrRightUp.std()/np.average(arrRightUp)*100, np.average(arrRightUp))
print("RightDown std , per, aver : ", arrRightDown.std(), arrRightDown.std()/np.average(arrRightDown)*100, np.average(arrRightDown))
log样式
02-25 11:23:49.557 2618 3175 E PreProcess: Fn:ComputeRealDepthByMap 0.193125
02-25 11:23:49.557 2618 3175 E PreProcess: Fn:2-box_filter 0.000209
02-25 11:23:49.557 2618 3175 E PreProcess: Fn:edgeSmoothing 0.000365
02-25 11:23:49.557 2618 3175 E PreProcess: FN:0314Depth center 1980
02-25 11:23:49.557 2618 3175 E PreProcess: FN:0314Depth LeftUp 2070
02-25 11:23:49.557 2618 3175 E PreProcess: FN:0314Depth LeftDown 1762
02-25 11:23:49.557 2618 3175 E PreProcess: FN:0314Depth RightUp 2265
02-25 11:23:49.557 2618 3175 E PreProcess: FN:0314Depth RightDown 1875
02-25 11:23:49.557 2618 3175 E PreProcess: Fn:Depth 2.137239