Esempio n. 1
0
        private void button_loadSamples_Click(object sender, EventArgs e)
        {
            string        path = Path.GetFullPath(textBox_sample_path.Text);
            DirectoryInfo dir  = new DirectoryInfo(path);

            if (dir.Exists == false)
            {
                MessageBox.Show("路径错误");
                return;
            }
            string pos_path = Path.Combine(path, "对称正样本");
            string neg_path = Path.Combine(path, "negBig");

            //string neg_path = Path.Combine(path, "negSamples");
            //string validate_path = Path.Combine(path, "validate");

            _posSamples                = SampleCollection.LoadPosSamples(pos_path, true, _colorType);
            _negSamples                = SampleCollection.LoadNegSamples(neg_path, _colorType, _size);
            _validateSamples           = _negSamples.GetNegSamples(_validateCount);
            _validateSamples.Capacity += _posSamples.Count;
            foreach (ISample s in _posSamples)
            {
                _validateSamples.Add(s);
            }
        }