Esempio n. 1
0
        public bool writeFeatures(_feature f)
        {
            if (this.openedStream == false)
            {
                openStream();
                this.openedStream = true;
            }

            file.Write(f.head.maxx.x + "," + f.head.maxx.y + "," + f.head.maxx.z + "," + f.head.maxy.x + "," + f.head.maxy.y + "," + f.head.maxy.z + "," + f.head.maxz.x + "," + f.head.maxz.y + "," + f.head.maxz.z);
            file.Write("," + f.head.minx.x + "," + f.head.minx.y + "," + f.head.minx.z + "," + f.head.miny.x + "," + f.head.miny.y + "," + f.head.miny.z + "," + f.head.minz.x + "," + f.head.minz.y + "," + f.head.minz.z);

            file.Write( "," + f.lShoulder.maxx.x + "," + f.lShoulder.maxx.y + "," + f.lShoulder.maxx.z + "," + f.lShoulder.maxy.x + "," + f.lShoulder.maxy.y + "," + f.lShoulder.maxy.z + "," + f.lShoulder.maxz.x + "," + f.lShoulder.maxz.y + "," + f.lShoulder.maxz.z);
            file.Write( "," + f.lShoulder.minx.x + "," + f.lShoulder.minx.y + "," + f.lShoulder.minx.z + "," + f.lShoulder.miny.x + "," + f.lShoulder.miny.y + "," + f.lShoulder.miny.z + "," + f.lShoulder.minz.x + "," + f.lShoulder.minz.y + "," + f.lShoulder.minz.z);

            file.Write( "," + f.rShoulder.maxx.x + "," + f.rShoulder.maxx.y + "," + f.rShoulder.maxx.z + "," + f.rShoulder.maxy.x + "," + f.rShoulder.maxy.y + "," + f.rShoulder.maxy.z + "," + f.rShoulder.maxz.x + "," + f.rShoulder.maxz.y + "," + f.rShoulder.maxz.z);
            file.Write( "," + f.rShoulder.minx.x + "," + f.rShoulder.minx.y + "," + f.rShoulder.minx.z + "," + f.rShoulder.miny.x + "," + f.rShoulder.miny.y + "," + f.rShoulder.miny.z + "," + f.rShoulder.minz.x + "," + f.rShoulder.minz.y + "," + f.rShoulder.minz.z);

            file.Write( "," + f.rElbow.maxx.x + "," + f.rElbow.maxx.y + "," + f.rElbow.maxx.z + "," + f.rElbow.maxy.x + "," + f.rElbow.maxy.y + "," + f.rElbow.maxy.z + "," + f.rElbow.maxz.x + "," + f.rElbow.maxz.y + "," + f.rElbow.maxz.z);
            file.Write( "," + f.rElbow.minx.x + "," + f.rElbow.minx.y + "," + f.rElbow.minx.z + "," + f.rElbow.miny.x + "," + f.rElbow.miny.y + "," + f.rElbow.miny.z + "," + f.rElbow.minz.x + "," + f.rElbow.minz.y + "," + f.rElbow.minz.z);

            file.Write( "," + f.lElbow.maxx.x + "," + f.lElbow.maxx.y + "," + f.lElbow.maxx.z + "," + f.lElbow.maxy.x + "," + f.lElbow.maxy.y + "," + f.lElbow.maxy.z + "," + f.lElbow.maxz.x + "," + f.lElbow.maxz.y + "," + f.lElbow.maxz.z);
            file.Write( "," + f.lElbow.minx.x + "," + f.lElbow.minx.y + "," + f.lElbow.minx.z + "," + f.lElbow.miny.x + "," + f.lElbow.miny.y + "," + f.lElbow.miny.z + "," + f.lElbow.minz.x + "," + f.lElbow.minz.y + "," + f.lElbow.minz.z);

            file.Write( "," + f.rHand.maxx.x + "," + f.rHand.maxx.y + "," + f.rHand.maxx.z + "," + f.rHand.maxy.x + "," + f.rHand.maxy.y + "," + f.rHand.maxy.z + "," + f.rHand.maxz.x + "," + f.rHand.maxz.y + "," + f.rHand.maxz.z);
            file.Write( "," + f.rHand.minx.x + "," + f.rHand.minx.y + "," + f.rHand.minx.z + "," + f.rHand.miny.x + "," + f.rHand.miny.y + "," + f.rHand.miny.z + "," + f.rHand.minz.x + "," + f.rHand.minz.y + "," + f.rHand.minz.z);

            file.Write( "," + f.lHand.maxx.x + "," + f.lHand.maxx.y + "," + f.lHand.maxx.z + "," + f.lHand.maxy.x + "," + f.lHand.maxy.y + "," + f.lHand.maxy.z + "," + f.lHand.maxz.x + "," + f.lHand.maxz.y + "," + f.lHand.maxz.z);
            file.Write( "," + f.lHand.minx.x + "," + f.lHand.minx.y + "," + f.lHand.minx.z + "," + f.lHand.miny.x + "," + f.lHand.miny.y + "," + f.lHand.miny.z + "," + f.lHand.minz.x + "," + f.lHand.minz.y + "," + f.lHand.minz.z);

            file.Write( "," + f.rWrist.maxx.x + "," + f.rWrist.maxx.y + "," + f.rWrist.maxx.z + "," + f.rWrist.maxy.x + "," + f.rWrist.maxy.y + "," + f.rWrist.maxy.z + "," + f.rWrist.maxz.x + "," + f.rWrist.maxz.y + "," + f.rWrist.maxz.z);
            file.Write( "," + f.rWrist.minx.x + "," + f.rWrist.minx.y + "," + f.rWrist.minx.z + "," + f.rWrist.miny.x + "," + f.rWrist.miny.y + "," + f.rWrist.miny.z + "," + f.rWrist.minz.x + "," + f.rWrist.minz.y + "," + f.rWrist.minz.z);

            file.Write("," + f.lWrist.maxx.x + "," + f.lWrist.maxx.y + "," + f.lWrist.maxx.z + "," + f.lWrist.maxy.x + "," + f.lWrist.maxy.y + "," + f.lWrist.maxy.z + "," + f.lWrist.maxz.x + "," + f.lWrist.maxz.y + "," + f.lWrist.maxz.z);
            file.Write("," + f.lWrist.minx.x + "," + f.lWrist.minx.y + "," + f.lWrist.minx.z + "," + f.lWrist.miny.x + "," + f.lWrist.miny.y + "," + f.lWrist.miny.z + "," + f.lWrist.minz.x + "," + f.lWrist.minz.y + "," + f.lWrist.minz.z);

            //^^162 coloumns

            file.Write("," + f.speedMps + "," + f.lHandSpeedMps + "," + f.peakAccel[0] + "," + f.peakDec[0] + "," + f.avgAccel[0] + "," + f.jerkIndex[0]);
            file.Write("," + f.rHandSpeedMps + "," + f.peakAccel[1] + "," + f.peakDec[1] + "," + f.avgAccel[1] + "," + f.jerkIndex[1]);
            file.Write("," + f.lElbowSpeedMps + "," + f.peakAccel[2] + "," + f.peakDec[2] + "," + f.avgAccel[2] + "," + f.jerkIndex[2]);
            file.Write("," + f.rElbowSpeedMps + "," + f.peakAccel[3] + "," + f.peakDec[3] + "," + f.avgAccel[3] + "," + f.jerkIndex[3]);

            //^^24(-3)coloumns/
              // for testing. done. no longer needed.
              //  file.WriteLine("\n"+f.acc+"\n"+f.sp+"\n"+f.dis);

            return true;
        }
Esempio n. 2
0
        public startFeatures()
        {
            this.wDist = new double[4];
            this.wDistLeg = new double[4];
            this.prevAccel = new double[4] ;
            this.prevAccelLeg = new double[4];

            this.prevSpeed = new double[4] ;
            this.prevSpeedLeg = new double[4] ;
            this.totJI = new double[4];

            this.wprevLeg = new _qbit[4];

            this.wprev = new _qbit[4];

            refreshVars();

            //passing a double value to the constructor is very important otherwise the default structconstructor is called and thigs don't get initialised. problem: objectreference error in feature arrays.
            feature = new _feature(0.0);
            //initFeatures is for the actual features while the prev inits are local vars.
            //initFeatures();
        }
Esempio n. 3
0
        private void makeFeatureSet(_feature f)
        {
            speed();
            dangSpeed();
            dangQuality();
            try
            {
                //this.featureSet[0] = f.speedMps;
                //this.featureSet[1] = f.lHandSpeedMps;
                ////          this.featureSet[0] =  f.peakAccel[0] ;
                //this.featureSet[2] = f.peakDec[0] / 100;
                //this.featureSet[3] = f.avgAccel[0];
                //this.featureSet[4] = f.jerkIndex[0] / 120;
                //this.featureSet[5] = f.rHandSpeedMps;
                //this.featureSet[6] = f.peakAccel[1] / 100;
                //this.featureSet[7] = f.peakDec[1] / 100;
                //this.featureSet[8] = f.avgAccel[1];
                //this.featureSet[9] = f.jerkIndex[1] / 120;
                //this.featureSet[10] = f.lElbowSpeedMps;
                //this.featureSet[11] = f.peakAccel[2] / 100;
                //this.featureSet[12] = f.peakDec[2] / 100;
                //this.featureSet[13] = f.avgAccel[2];
                //this.featureSet[14] = f.jerkIndex[2] / 120;
                //this.featureSet[15] = f.rElbowSpeedMps;
                //this.featureSet[16] = f.peakAccel[3] / 100;
                //this.featureSet[17] = f.peakDec[3] / 100;
                //this.featureSet[18] = f.avgAccel[3];
                //this.featureSet[19] = f.jerkIndex[3] / 120;

                this.featureSet = new double[7];

                this.featureSet[0] = this.feature.speedMps/2;
                this.featureSet[1] = this.feature.lHandSpeedMps/2;
                this.featureSet[2] = this.feature.rHandSpeedMps/2;
                this.featureSet[3] = this.feature.avgAccel[0]/2;
                //            this.featureSet[4] = this.feature.jerkIndex[0] / 120/2;
                this.featureSet[4] = this.feature.avgAccel[1]/2;
                //            this.featureSet[9] = this.feature.jerkIndex[1] / 120/2;
                this.featureSet[5] = this.feature.avgAccel[2]/2;
                //            this.featureSet[14] = jerkIndex[2] / 120/2;
                this.featureSet[6] = this.feature.avgAccel[3]/2;
                //            this.featureSet[19] = this.feature.f.jerkIndex[3] / 120/2;
                for(int i=0;i<7;i++)
                    Console.Write(this.featureSet[i]+"--");
                Console.WriteLine("");
                //double[] dummyset = new double[12];
                //for (int i = 0; i < 7; i++)
                //    dummyset[i] = featureSet[i];
                //dummyset[20] = wDist[0];
                //dummyset[21] = wDist[1];
                //dummyset[22] = wDist[2];
                //dummyset[23] = wDist[3];
                //dummyset[24] = frame;
                //file.WritefeatureSet(dummyset);

            }

            catch {
                System.Windows.MessageBox.Show("Not Enough Memory or whatever.", "featureset error",
                    MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }