Beispiel #1
0
        private void btnSearch_Click(object sender, EventArgs e)
        {
            if (picDedo.Image == null)
            {
                txtOut.Text = "Selecione uma imagem, ou capture uma nova pelo leitor";
                return;
            }
            try
            {
                Fingerprint fp;
                Bitmap      bmp = picDedo.Image as Bitmap;
                if (chkBitmap.Checked)
                {
                    txtOut.Text = "BITMAP " + bmp.Width + "x" + bmp.Height;
                    fp          = new Fingerprint(idKit, picDedo.Image);
                }
                else
                {
                    txtOut.Text = "RAW IMAGE " + bmp.Width + "x" + bmp.Height;
                    var img = BitmapArray(bmp);
                    fp = new Fingerprint(img.ToArray(), bmp.Width, bmp.Height);
                }

                txtOut.Text += "Quality: " + fp.Quality;
                SearchResult result = idKit.Find(fp, NomeDigitais.Values.ToArray());

                txtOut.Text += " Count: " + result.Count + " Best(Id): " + result.Best.Id;
                if (result.Count == 1 && result.Best.Id >= 0)
                {
                    txtOut.Text += "\r\nIdentificado: " + NomeDigitais.Keys[result.Best.Id];
                }
                else
                {
                    txtOut.Text += "\r\nNão identificado";
                }
            }
            catch (Exception ex)
            {
                ShowError(ex);
            }
        }