예제 #1
0
        private void button5_Click(object sender, EventArgs e)
        {
            object selectedValue = itemsource[0];

            if (selectedValue != null)
            {
                Type selectedType = (Type)selectedValue;
                currFeatDisplay = Activator.CreateInstance(selectedType) as IFeatureDisplay;
                Type currFeatType = featTypeByDisplay[selectedType];
                selitem = extractorsByFeatType[currFeatType];
            }
            object selvalue = selitem[0];

            if (selvalue != null)
            {
                Type selType = (Type)selvalue;
                currExtractor = Activator.CreateInstance(selType) as IFeatureExtractor;
            }
            if (img == null)
            {
                MessageBox.Show("You must select an image!", "Displaying error", MessageBoxButtons.OK, MessageBoxIcon.Error);
                return;
            }

            pictureBox5.Image = img.Clone() as Bitmap;
            Graphics g = Graphics.FromImage(pictureBox5.Image);
            {
                var features = currExtractor.ExtractFeatures(img);
                currFeatDisplay.Show(features, g);
                button6.Visible = true;
                //groupBox6.Visible = true;
            }
        }
예제 #2
0
        private void cbxFeatureTypes_SelectedValueChanged(object sender, EventArgs e)
        {
            object selectedValue = ((ComboBox)sender).SelectedItem;

            if (selectedValue != null)
            {
                Type selectedType = (Type)selectedValue;
                currFeatDisplay = Activator.CreateInstance(selectedType) as IFeatureDisplay;
                Type currFeatType = featTypeByDisplay[selectedType];
                cbxFeatureExtractors.DataSource    = extractorsByFeatType[currFeatType];
                cbxFeatureExtractors.DisplayMember = "Name";
                cbxFeatureExtractors.ValueMember   = "Name";
            }
            display_minutiae_features();
        }