Documentos de Académico
Documentos de Profesional
Documentos de Cultura
/**
* Creates new form JPanelImagenBinarizada
*/
public JPanelImagenMadurezBinarizar() {
initComponents();
matriz = new int[numeroFilas][numeroColumnas];
Dimension d = new Dimension(DIMENSION_ANCHO + 1, DIMENSION_ALTO + 1);
this.setPreferredSize(d);
this.setSize(d);
}
@Override
public void paint(Graphics g) {
super.paint(g); //To change body of generated methods, choose Tools |
Templates.
if (rutaImagen != null) {
g.drawImage(imagen_actual, 0, 0, ancho, alto, this);
if (pintarLineas) {
pintarLineasMatriz(g);
}
setOpaque(false);
}
}
/**
* Cargamos la imagen
*/
public void cargarImagenOriginal() {
try {
imagenBufferedImageOriginal = ImageIO.read(archivoImagen);
} catch (IOException ex) {
System.out.println("Excepcion al leer el archivo: " + ex);
}
// obtener ancho y alto de la archivoImagen
ajusteImagen();
try {
imagen1T = imagenBufferedImageOriginal.getScaledInstance(ancho, alto,
Image.SCALE_AREA_AVERAGING);
} catch (Exception ex) {
System.out.println("Excepcion al escalar la imagen: " + ex);
}
imagen_actual = imagen1T;
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">