Exemplo n.º 1
0
             [33, 33, 33, 33, 28, 24, 19, 17, 15, 14],
             [15, 14, 12, 12, 14, 15, 16, 17.5, 17.5, 17.5],
             [17.5, 17.5, 16, 15, 14, 13, 12, 12, 14, 15]
        ]
"""
str = qu.appendAtom(atoms[0], atoms[1])
str = qu.appendAtom(str, atoms[2])
str = qu.appendAtom(str, atoms[3])
plt.plot(str)
"""
alphabetSize = 10
sizeOfAtom=10
#radius=2
numOfClusters=12
disFactor = 0.1
vecs, mats = qu.createClustersAndMatchingMatrices(cleanedParts, atoms, 
                                    numOfClusters, disFactor)
       
strides = qu.createStridesFromAtoms(mats, vecs)
st.plotParts(strides)
plt.show()
whole = qu.orderWithCost(strides)
plt.figure()
plt.plot(whole)

plt.show()





Exemplo n.º 2
0
 for (t, a), part in zip(originalFracs,cleanedParts):
     frameSize = math.ceil(np.sqrt(len(fracs)))
     curr = fig.add_subplot(frameSize,frameSize,i+1)
     plt.title(str(i))
     plt.xlabel('Time in miliseconds')
     plt.ylabel('Right knee angle in degrees')
     curr.plot(xrange(len(a)), a, c='b')
     curr.plot(part, c='g')
     i+=1
 st.plotParts(cleanedParts, 'Frames', 'Knee angle', xrange(len(cleanedParts)))#, (0,100), (0,45))
 """
 alphabetSize = 10
 sizeOfAtom=10
 radius=2
 numOfClusters=2
 vecs, mats = qu.createClustersAndMatchingMatrices(cleanedParts, atoms, radius, sizeOfAtom, 
                                           alphabetSize, numOfClusters)
 strides = qu.createStridesFromAtoms(mats, vecs)
 xlabel = 'Frames(each frame is 33 miliseconds)'
 ylabel = 'Right knee angle (in degrees)'
 #st.plotParts(strides, xlabel, ylabel, xrange(len(strides)))
 if(numOfClusters > 2):
     whole = qu.orderWithCost(strides)
 else: 
     if(numOfClusters == 2) :
         byOrderDis = qu.getDistanceBetweenAtoms(strides[0], strides[1])
         byOrder = qu.appendAtom(strides[0], strides[1])
         inverseDis = qu.getDistanceBetweenAtoms(strides[1], strides[0])
         inverse = qu.appendAtom(strides[1], strides[0])
         whole = byOrder if byOrderDis < inverseDis else inverse
     else:
         whole = strides[0]