Example #1
0
        private void SaveRegressionModel(string filename)
        {
            RidgeRegression[] models = new RidgeRegression[] { RegressionX, RegressionY };

            XmlSerializer xs = new XmlSerializer(typeof(RidgeRegression[]));
            StreamWriter  sw = new StreamWriter(filename);

            xs.Serialize(sw, models);
            sw.Close();
        }
        public static RidgeRegression Load(string filename)
        {
            XmlSerializer   xs = new XmlSerializer(typeof(RidgeRegression));
            StreamReader    sr = new StreamReader(filename);
            RidgeRegression r  = (RidgeRegression)xs.Deserialize(sr);

            sr.Close();

            return(r);
        }
Example #3
0
        private void LoadRegressionModel(string filename)
        {
            XmlSerializer xs = new XmlSerializer(typeof(RidgeRegression[]));
            StreamReader  sr = new StreamReader(filename);

            RidgeRegression[] models = (RidgeRegression[])xs.Deserialize(sr);
            sr.Close();

            RegressionX = models[0];
            RegressionY = models[1];
        }
Example #4
0
        // constructor
        public FormMain()
        {
            InitializeComponent();

            LoadDefaultSettings();

            this.propertyGridSettings.SelectedObject = settings;

            int n = (settings.FeatureExtraction_PatchWidth * settings.FeatureExtraction_PatchHeight) * 2 + 5;

            RegressionX = new RidgeRegression(n);
            RegressionY = new RidgeRegression(n);

            faceClassifier = new CascadeClassifier(faceFileName);
            eyeClassifier  = new CascadeClassifier(eyeFileName);
        }