public byte[] Imglist(int id) { var x = new DataSet1TableAdapters.DesaparecidosTableAdapter(); var y = x.ListaImagenes(id); return((byte[])y); }
private async void button1_Click(object sender, EventArgs e) { try { var x = new DataSet1TableAdapters.DesaparecidosTableAdapter(); var z = new DataSet1TableAdapters.RegistroSimilitudTableAdapter(); var y = x.GetDataBy3(); img1 = pictureBox2.Image; for (int i = 0; i < y.Count; i++) { if (Imglist(y[i].id) != null) { img2 = ByteArrayToImage(Imglist(y[i].id)); await FindSimilar(clientFace, imagen(img1), imagen(img2), RECOGNITION_MODEL1); if (porcent > 55) { MessageBox.Show("Esta Imagen es parecida con un " + porcent + "%" + " con el desaparecido: " + x.GetNombreDesaparecido(y[i].id) + " Con el Correo: " + x.GetCorreoDesaparecida(y[i].id)); z.InsertQueryRegistroSimilutud(ImageToByteArray(img1), y[i].id, DateTime.Now, GetLocationProperty(), Convert.ToDouble(porcent)); MessageBox.Show(GetLocationProperty()); SendCorreos(x.GetCorreoDesaparecida(y[i].id).ToString(), "Encontramos tu desaparecido", "hay Imagen es parecida con un " + porcent + "% de similitud" + " con el desaparecido: " + x.GetNombreDesaparecido(y[i].id) + ",\n en la siguiente ubicacion " + GetLocationProperty() + " Verifique su aplicacion y use el codigo de verificacion: " + z.GetUltimoID()); break; } } } if (porcent <= 55) { MessageBox.Show("No se Encontraron Similitudes con ningun desaparecido"); } button1.Visible = false; button2.Visible = true; } catch (Exception) { } }
public Validador() { InitializeComponent(); z = new DataSet1TableAdapters.RegistroSimilitudTableAdapter(); x = new DataSet1TableAdapters.DesaparecidosTableAdapter(); }