private void button_load_cascade_Click(object sender, EventArgs e) { if (openFileDialog1.ShowDialog() == DialogResult.OK) { _cascadeClassifier = XmlClass.Load(openFileDialog1.FileName); } }
private void button_viewCascade_Click(object sender, EventArgs e) { if (_cascadeClassifier == null || _cascadeClassifier.StageCount <= 0) { _cascadeClassifier = XmlClass.Load(@"cascade_0.000001_0.5_0.99_gray_saturation_20150507_step2neg_height14.xml"); } //查看生成的所有特征矩形 // cascadeClassifier = new CascadeClassifier(); // cascadeClassifier.Size = _size; // WeakClassifierManager.Instance.CreateHaarFeatures(_size.Width, _size.Height / 2, colorType); // WeakClassifierManager.Instance.AddSymmetricHaarFeatures(_size.Width, _size.Height, colorType); // StageClassifier stage = new StageClassifier(0); // stage.Classifiers = WeakClassifierManager.Instance.WeakClassifiers; // cascadeClassifier.Classifiers=new StageClassifier[]{stage}; FormViewRect fv = new FormViewRect(_cascadeClassifier); fv.Show(); }