Ejemplo n.º 1
0
        static void Example1(List <object> trainingdatafiles, List <object> testingdatafiles, string outtrainpath, string outtestpath)
        {
            //number of frames in standardized gait cycle curves
            uint L = 100;
            //continuous edge ratio
            float tau = 0.1f;
            //number of gait phases
            uint K = 9;
            //number of features per frame
            uint Z = 12;
            //total desired number of feature pairs
            int Ohm = 420;
            //number of adjacent standardized frames that are used for determining whether feature pairs are duplicated
            int t = 6;


            //Step1: fill in standardized cycles from training set
            var dataset = LoadStandardizedDataset(trainingdatafiles, Z, K);

            //Step2: perform gait pattern clustering and averaging
            NativeAPI.Clustering(dataset, tau);

            //Step3: perform feature pair extraction
            var featurepairs = NativeAPI.ExtractFeaturePairs(dataset, Ohm, t);

            NativeAPI.DestoryDataSet(dataset);//release resources if not used anymore


            //Step5: compute and export features of the training dataset to file
            // choose one from the following two lines according to data scale
            var training_dataset = LoadNormalDataset(trainingdatafiles, Z, K);

            //var training_dataset = LoadStandardizedDataset(trainingdatafiles, Z, K);
            NativeAPI.ComputeFeatures(training_dataset, featurepairs, outtrainpath, L);
            NativeAPI.DestoryDataSet(training_dataset);//release resources if not used anymore

            //Step6: compute and export features of the testing dataset to file
            var testing_dataset = LoadNormalDataset(testingdatafiles, Z, K);

            NativeAPI.ComputeFeatures(testing_dataset, featurepairs, outtestpath, L);
            NativeAPI.DestoryDataSet(testing_dataset);//release resources if not used anymore
        }
Ejemplo n.º 2
0
        static void Example2(List <object> trainingdatafiles, List <object> testingdatafiles, string outtrainpath, string outtestpath)
        {
            //number of gait phases
            uint K = 9;
            //number of features per frame
            uint Z = 12;

            //fill data in a dataset
            var dataset = LoadNormalDataset(trainingdatafiles, Z, K);

            //save the dataset to somewhere
            NativeAPI.SaveDataSet(dataset, @"drive:\someplace");
            NativeAPI.DestoryDataSet(dataset);//release resources if not used anymore


            //reload the dataset from somewhere
            var dataset1 = NativeAPI.LoadDataSet(@"drive:\someplace", Z, K);

            NativeAPI.DestoryDataSet(dataset1);//release resources if not used anymore
        }