cs_mmlm
Messages postés5Date d'inscriptionvendredi 25 novembre 2011StatutMembreDernière intervention14 décembre 2011
-
10 déc. 2011 à 10:44
cs_mmlm
Messages postés5Date d'inscriptionvendredi 25 novembre 2011StatutMembreDernière intervention14 décembre 2011
-
14 déc. 2011 à 14:40
Je souhaite afficher le contour d'une images avec une application java. Sur le site je n'ai trouvé que des exemples avec c++ or je dois utiliser JAVA.j'ai essayer de le convertir mais je n'arrive pas.
merci
Twinuts
Messages postés5375Date d'inscriptiondimanche 4 mai 2003StatutModérateurDernière intervention14 juin 2023111 10 déc. 2011 à 11:22
Salut,
Ok, c'est pas compliqué de donner quelques info sur ce que tu sais ou pas faire (ça aide à pas te/nous faire perdre du temps)...
Cela dit tu n'as pas cherché bien loin... ou tu as bien mal chercheé... en tapant "java detection de contour" sur google je tombe en premier lien sur "http://www.developpez.net/forums/d298554/java/interfaces-graphiques-java/graphisme/2d/detection-contour/... en bas du post tu as le code java...
------------------------------------
"On n'est pas au resto : ici on ne fait pas dans les plats tout cuits ..."
Twinuts
Messages postés5375Date d'inscriptiondimanche 4 mai 2003StatutModérateurDernière intervention14 juin 2023111 10 déc. 2011 à 10:53
Salut,
Tu n'y arrives pas à quel niveau ? tu déjà fais quoi ? etc... ?
N’espère pas lâcher une simple 'je n'y arrive pas" et obtenir du code... il nous faut de la matière.
------------------------------------
"On n'est pas au resto : ici on ne fait pas dans les plats tout cuits ..."
cs_mmlm
Messages postés5Date d'inscriptionvendredi 25 novembre 2011StatutMembreDernière intervention14 décembre 2011 10 déc. 2011 à 11:02
je ne sais pas quel sont les bibliothèque nécessaire et bien sur les instruction qui concerne l'action de bouton qui effectue la détection du contour .
Twinuts
Messages postés5375Date d'inscriptiondimanche 4 mai 2003StatutModérateurDernière intervention14 juin 2023111 10 déc. 2011 à 11:05
Donc tu ne connais pas les bases en java, ni même celles pour faire des ihm et encore moi pour la manipulation d'image et tu souhaites faire ce genre d'application pour commencer ?
------------------------------------
"On n'est pas au resto : ici on ne fait pas dans les plats tout cuits ..."
OoWORAoO
Vous n’avez pas trouvé la réponse que vous recherchez ?
cs_mmlm
Messages postés5Date d'inscriptionvendredi 25 novembre 2011StatutMembreDernière intervention14 décembre 2011 10 déc. 2011 à 11:12
Mais non!!!!!!!!!!!!
je réalise des interface graphique qui permet de parcourir une image puis la redimensionne et effectue aussi des rotation mais c'est juste les instruction de détection de contour que j'ai besoin pour compléter mon projet
cs_mmlm
Messages postés5Date d'inscriptionvendredi 25 novembre 2011StatutMembreDernière intervention14 décembre 2011 14 déc. 2011 à 14:40
Bonjour
je suis en cour de réaliser un programme java qui détecte le contour d'une image mais je n'arrive pas ,je trouve dans le site une méthode qui nécessite
un bafferedImage or je besion d'une methode avec plannarImage ou bien un bout de code qui permet de forsage de type plannar image vers bufferd image
voici le code d'action performed de boutton de l'inerface:
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
/*
* FENETRE.java
*
* Created on 13 déc. 2011, 19:34:42
*/
/**
*
* @author Administrateur
*/
public class FENETRE extends javax.swing.JFrame {
/** Creates new form FENETRE */
public FENETRE() {
initComponents();
}
/** 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">
private void initComponents() {
jButton1 = new javax.swing.JButton();
url = new java.awt.TextField();
img = new javax.swing.JLabel();
jButton2 = new javax.swing.JButton();
jLabel1 = new javax.swing.JLabel();
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
JFileChooser jf = new JFileChooser ();
jf.showOpenDialog(null);
url.setText(jf.getSelectedFile().getPath());
PlanarImage p=JAI.create("fileload",url.getText());
img.setIcon(new ImageIcon(p.getAsBufferedImage()));
}
public static BufferedImage contour(BufferedImage img) {
BufferedImage dst = new BufferedImage(img.getWidth(), img.getHeight(),
BufferedImage.TYPE_INT_ARGB);
// Definition du masque de convolution utilisé pour la détéction des contours de
// l'image
float[] mask = { -0.1F, -0.1F, -0.1F, -0.1F, 0.8F, -0.1F, -0.1F, -0.1F, -0.1F};
Kernel kernel = new Kernel(3, 3, mask);
// On creer notre outils de convolution
ConvolveOp convo = new ConvolveOp(kernel);
// On effectue la convolution
convo.filter(img, dst);
// On retourne l'image convoluée
return dst;
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
PlanarImage u=JAI.create("fileload",url.getText());
BufferedImage u = FENETRE.contour(img);