示例#1
0
        public static MyPostureTraining create1()
        {
            MyPostureTraining training = new MyPostureTraining();

            using (StreamReader sr = new StreamReader(Constant.BASE_PATH + "/data/data1/data.txt"))
            {
                for (int i = 1; i <= 9; i++)
                {
                    Posture           pos            = new Posture(PostureType.Both);
                    List <VectorType> vectorTypeList = PostureRecognition.getVectorTypeList(PostureType.Both);
                    pos.setPic(Constant.BASE_PATH + "/data/data1/" + i + "_color.jpg");

                    foreach (VectorType type in vectorTypeList)
                    {
                        string[] lineData = sr.ReadLine().Split(',');
                        pos.setVector(type, new Vector(double.Parse(lineData[0]), double.Parse(lineData[1]), double.Parse(lineData[2])));
                    }
                    sr.ReadLine();
                    training.PostureList.Add(pos);
                }
            }

            return(training);
        }