コード例 #1
0
        public void ComputeFeatures()
        {
            List <double> diffX = Diff(X);

            List <double> diffY = Diff(Y);

            List <double> diffTimestamp = Diff(Timestamp);



            // Article base features
            // Stroke length
            double strokeLength = Pythagorean(diffX, diffY);

            Features.Add("length", strokeLength);



            // Stroke speed -> Avg
            // length / (last touch features time - first touch features time)
            double speedMean = strokeLength / (Timestamp.Last() - Timestamp.First());

            Features.Add("mean speed", speedMean);



            // Directness index (distance between start and end -> ignores path) -> Avg
            double directness = Distance(X.First(), X.Last(), Y.First(), Y.Last());

            Features.Add("directness", directness);



            // Contact Area (Touch Major) -> Avg
            double contactArea = TouchMajor.Average();

            Features.Add("mean contact area", contactArea);

            //double contactAreaMin = TouchMajor.Min();
            //Features.Add("min contact area", contactAreaMin);

            //double contactAreaMax = TouchMajor.Max();
            //Features.Add("max contact area", contactAreaMax);

            //double contactAreaStd = Measures.StandardDeviation(TouchMajor.ToArray(), false);
            //Features.Add("std max contact area", contactAreaStd);
        }
コード例 #2
0
ファイル: Sample.cs プロジェクト: jbgrocha/ADBLogParser
        public override string ToString()
        {
            string result = "";

            result += Timestamp.ToString();

            result += ";" + ButtonTouch.ToString();

            result += ";" + MultitouchID.ToString();

            result += ";" + X.ToString();
            result += ";" + Y.ToString();

            result += ";" + TouchMajor.ToString();
            result += ";" + WidthMajor.ToString();

            result += ";" + TouchMinor.ToString();
            result += ";" + Pressure.ToString();

            return(result);
        }