public void EsMaduro(int opcion, CDiccionario datos) { DataSet dtsDatos = new DataSet(); CDiccionario objaux = new CDiccionario(); bool BolRegistro = false; if (ExisteConexion()) { BolRegistro = objaux.EsMaduro(opcion, ref dtsDatos, datos); if (BolRegistro == true) { ViewDiccionario.DatosDT = dtsDatos; string a = dtsDatos.Tables[0].Rows[0][0].ToString(); string b = dtsDatos.Tables[0].Rows[0][1].ToString(); ViewDiccionario.MensajeDiccionario(a + "|" + b, 6); } else { ViewDiccionario.MensajeDiccionario(" ", 0); } } }
public Vision() { InitializeComponent(); CheckForIllegalCrossThreadCalls = false; vistaCamara = new WCamara(this); vistaDiccionario = new WDiccionario(this); objDiccionario = new CDiccionario(); miHistograma = new Histograma(); ArudinoConexion = conexionSerial.Instance; WconexionSerial = new WConexionSerial(this); bandera = true; }
public void Reguistrar(int op, CDiccionario obj) { bool BolRegistro = false; if (ExisteConexion()) { BolRegistro = objDiccionario.insert(op, obj); } if (BolRegistro == true) { ViewDiccionario.MensajeDiccionario("Se registro", 1); } else { ViewDiccionario.MensajeDiccionario("No se registro", 2); } }
private void GuardarFotp() { img = null; try { img = new Bitmap(pictureBoxCamara.Image); } catch (Exception) { img = new Bitmap(pictureBoxCamara.Image); } //GUARDAR IMAGEN EN LA RUTA- se recorta la imagen orginar pictureBoxFotoGenerica.Image = CropBitmap(img, 500, 500, 220, 220); Bitmap fotoProcesada = new Bitmap(pictureBoxFotoGenerica.Image); int[,] values = miHistograma.getHistograma(fotoProcesada); int[] rojo = new int[values.GetLength(1)]; int[] verde = new int[values.GetLength(1)]; int[] azul = new int[values.GetLength(1)]; int[] generico = new int[values.GetLength(1)]; for (int i = 0; i < values.GetLength(0); i++) { for (int j = 0; j < values.GetLength(1); j++) { rojo[j] = (i == 0) ? values[i, j] : rojo[j]; verde[j] = (i == 1) ? values[i, j] : verde[j]; azul[j] = (i == 2) ? values[i, j] : azul[j]; } } histogramRojo.Values = rojo; histogramVerde.Values = verde; histogramAzul.Values = azul; int[] vR = miHistograma.GetPorcentajesColor(rojo); int[] vV = miHistograma.GetPorcentajesColor(verde); int[] vA = miHistograma.GetPorcentajesColor(azul); CDiccionario valuesR = new CDiccionario(); valuesR.valueAr = vR[0]; valuesR.valueBr = vR[1]; valuesR.valueCr = vR[2]; valuesR.valueDr = vR[3]; valuesR.valueAv = vV[0]; valuesR.valueBv = vV[1]; valuesR.valueCv = vV[2]; valuesR.valueDv = vV[3]; valuesR.valueAa = vA[0]; valuesR.valueBa = vA[1]; valuesR.valueCa = vA[2]; valuesR.valueDa = vA[3]; valuesR.tipo = 1; vistaDiccionario.Reguistrar(1, valuesR); }
/// <summary> /// Metodo que se encarga de procesar la imagen /// </summary> private void proceso() { img = null; try { img = new Bitmap(pictureBoxCamara.Image); } catch (Exception) { if (pictureBoxCamara.InvokeRequired) { CambiarProgresoDelegadoFoto delegadoArduino = new CambiarProgresoDelegadoFoto(proceso); this.Invoke(delegadoArduino, null); } else { img = new Bitmap(pictureBoxCamara.Image); } } //GUARDAR IMAGEN EN LA RUTA- se recorta la imagen orginar pictureBoxFotoGenerica.Image = CropBitmap(img, 500, 500, 220, 220); Bitmap fotoProcesada = new Bitmap(pictureBoxFotoGenerica.Image); int[,] values = miHistograma.getHistograma(fotoProcesada); int[] rojo = new int[values.GetLength(1)]; int[] verde = new int[values.GetLength(1)]; int[] azul = new int[values.GetLength(1)]; int[] generico = new int[values.GetLength(1)]; for (int i = 0; i < values.GetLength(0); i++) { for (int j = 0; j < values.GetLength(1); j++) { rojo[j] = (i == 0) ? values[i, j] : rojo[j]; verde[j] = (i == 1) ? values[i, j] : verde[j]; azul[j] = (i == 2) ? values[i, j] : azul[j]; } } histogramRojo.Values = rojo; histogramVerde.Values = verde; histogramAzul.Values = azul; int[] vR = miHistograma.GetPorcentajesColor(rojo); int[] vV = miHistograma.GetPorcentajesColor(verde); int[] vA = miHistograma.GetPorcentajesColor(azul); CDiccionario valuesR = new CDiccionario(); valuesR.valueAr = vR[0]; valuesR.valueBr = vR[1]; valuesR.valueCr = vR[2]; valuesR.valueDr = vR[3]; valuesR.valueAv = vV[0]; valuesR.valueBv = vV[1]; valuesR.valueCv = vV[2]; valuesR.valueDv = vV[3]; valuesR.valueAa = vA[0]; valuesR.valueBa = vA[1]; valuesR.valueCa = vA[2]; valuesR.valueDa = vA[3]; vistaDiccionario.EsMaduro(6, valuesR); }
public WDiccionario(IDiccionario InterfazDiccionario) { objDiccionario = new CDiccionario(); Manager = new ManagerBD(); ViewDiccionario = InterfazDiccionario; }