public void readTags(string[] tags, int baseId = 0) { timestamp.Add(float.Parse(tags[baseId + 0])); X_POS x = new X_POS(); for (int i = 0; i < x.N; i++) { x.vec[i] = float.Parse(tags[baseId + 1 + i]); } Y_POS y = new Y_POS(); for (int i = 0; i < y.N; i++) { y.vec[i] = float.Parse(tags[baseId + 1 + x.N + i]); } xPos.Add(x); yPos.Add(y); xPosSmooth.Add(xRollingMean(xPos)); yPosSmooth.Add(yRollingMean(yPos)); }
private void segment() { int startIndex = -1; int endIndex = -1; segmentCheck(out startIndex, out endIndex); timestamp = timestamp.GetRange(startIndex, endIndex - startIndex + 1); xPos = xPos.GetRange(startIndex, endIndex - startIndex + 1); yPos = yPos.GetRange(startIndex, endIndex - startIndex + 1); xStart = xPos[0]; yStart = yPos[0]; int T = timestamp.Count; float startTime = timestamp[0]; for (int t = 0; t < T; t++) { xPos[t] = new X_POS(xPos[t] - xStart); yPos[t] = new Y_POS(yPos[t] - yStart); timestamp[t] -= startTime; } }