Contour actif

takwatouma Messages postés 11 Date d'inscription mercredi 10 décembre 2008 Statut Membre Dernière intervention 11 mars 2009 - 28 févr. 2009 à 12:56
hibabensaid Messages postés 6 Date d'inscription mardi 3 février 2009 Statut Membre Dernière intervention 1 février 2010 - 14 nov. 2009 à 15:23
Bonjour,
J'ai testé  le code de ontour actif mais je trouve un pb d'appliquer sur mon image?
voila une portion de code.
merci de me donner idéé.

public class Snake {

    // Points of the snake
    private List snake;

    // Length of the snake (euclidean distance)
    private double snakelength=0;

    // size of the image (and of the 2 arrays below)
    private int width=0,height=0;

    // gradient value (modulus)
    private int[][] gradient;

    // gradient flow (modulus)
    private int[][] flow;

    // 3x3 neighborhood used to compute energies
    private double[][] e_uniformity = new double[3][3];
    private double[][] e_curvature  = new double[3][3];
    private double[][] e_flow       = new double[3][3];
    private double[][] e_inertia    = new double[3][3];

    // auto add/remove points to the snake
    // according to distance between points
    private boolean AUTOADAPT=true;
    private static int AUTOADAPT_LOOP=10;
    private static int AUTOADAPT_MINLEN=8;
    private static int AUTOADAPT_MAXLEN=16;

    // maximum number of iterations (if no convergence)
    private static int MAXITERATION = 1000;

    // coefficients for the 4 energy functions
    public double alpha=1.1, beta=1.2, gamma=1.5, delta=3.0;
    // alpha coefficient for uniformity (high> force equals distance between points)    // beta  coefficient for curvature  (high> force smooth curvature)    // gamma  coefficient for flow      (high> force gradient attraction)    // delta  coefficient for intertia  (high> get stuck to gradient)

    /**
     * Constructor
     *
     * @param width,height size of the image and of the 2 following arrays
     * @param gradient gradient (modulus)
     * @param flow gradient flow (modulus)
     * @param points inital points of the snake
     */
    public Snake(int width, int height, int[][] gradient, int[][] flow, Point... points) {
        this.snake = snake;
        this.gradient = gradient;
        this.flow = flow;
        this.width = width;
        this.height = height;
    }
    public static void main (String[]args)
    {
        Snake s=new Snake();
        s.SetVisible(true);
    }

}

1 réponse

hibabensaid Messages postés 6 Date d'inscription mardi 3 février 2009 Statut Membre Dernière intervention 1 février 2010
14 nov. 2009 à 15:23
bonjour takwatouma
je suis entrain aussi d'utiliser le contour actif pour la detection des traits de visage(yeux, bouche, nez) avec matlab mais pas java.
j'ai detecter les yeux mais le pb pour les yeux et nez.
je n'ai pas compris dans quelle but vous utilisez le contour actif pour la segmentetion d quoi?
amicalement
0
Rejoignez-nous