IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Traitement d'images Discussion :

Stereovision "local consistency implementation"


Sujet :

Traitement d'images

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre éclairé

    Profil pro
    Inscrit en
    Janvier 2008
    Messages
    788
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2008
    Messages : 788
    Par défaut Stereovision "local consistency implementation"
    Bonjour, j'essaie d’implémenter l'algorithme de localconsistency.

    Voici une courte description



    That is, modeling local surfaces as frontal-parallel, the
    posterior probability P R
    fg(D(f)) of a specific disparity
    hypothesis D(f) implicitly made by the blue point f on
    the red point g is related to the spatial proximity between
    (f, g), (f', g') and to the color proximity between (f, g),
    (f', g'), (f, f'). Color and spatial proximity are encoded
    according to the Euclidean distance (see [15] for details).

    Donc voici une version simplifie de mon algorithme

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    for (int disp = 0; disp < maxdisp; ++disp)
        {
            for (unsigned int i = 0; i < left->width; ++i)
            {
                for (unsigned int j = 0; j < left->height; ++j)
                {
                    CvPoint center = cvPoint(i + (winsize - 1) / 2, j + (winsize - 1) / 2);
                    for (unsigned int x = 0; x < winsize; ++x)
                    {
                        for (unsigned int y = 0; y < winsize; ++y)
                        {
                                    //center diff color
                                    CV_IMAGE_ELEM(ret[disp], float, j + y, i + x) += abs(CV_IMAGE_ELEM(left, uchar, center.y, center.x * 3)
                                            - CV_IMAGE_ELEM(right, uchar, center.y, (center.x + disp) * 3));
                                    CV_IMAGE_ELEM(ret[disp], float, j + y, i + x) += abs(CV_IMAGE_ELEM(left, uchar, center.y, center.x * 3 + 1)
                                            - CV_IMAGE_ELEM(right, uchar, center.y, (center.x + disp) * 3 + 1));
                                    CV_IMAGE_ELEM(ret[disp], float, j + y, i + x) += abs(CV_IMAGE_ELEM(left, uchar, center.y, center.x * 3 + 2)
                                            - CV_IMAGE_ELEM(right, uchar, center.y, (center.x + disp) * 3 + 2));
     
                                    //left center to point color
                                    CV_IMAGE_ELEM(ret[disp], float, j + y, i + x) += abs(CV_IMAGE_ELEM(left, uchar, center.y, center.x * 3)
                                            - CV_IMAGE_ELEM(left, uchar, j + y, (i + x) * 3));
                                    CV_IMAGE_ELEM(ret[disp], float, j + y, i + x) += abs(CV_IMAGE_ELEM(left, uchar, center.y, center.x * 3 + 1)
                                            - CV_IMAGE_ELEM(left, uchar, j + y, (i + x) * 3 + 1));
                                    CV_IMAGE_ELEM(ret[disp], float, j + y, i + x) += abs(CV_IMAGE_ELEM(left, uchar, center.y, center.x * 3 + 2)
                                            - CV_IMAGE_ELEM(left, uchar, j + y, (i + x) * 3 + 2));
     
                                    // right center to point color
                                    if (i + x + disp < left->width)
                                    {
                                        CV_IMAGE_ELEM(ret[disp], float, j + y, i + x) += abs(CV_IMAGE_ELEM(right, uchar, center.y, (center.x + disp) * 3)
                                                - CV_IMAGE_ELEM(right, uchar, j + y, (i + x + disp) * 3));
                                        CV_IMAGE_ELEM(ret[disp], float, j + y, i + x) += abs(CV_IMAGE_ELEM(right, uchar, center.y, (center.x + disp) * 3 + 1)
                                                - CV_IMAGE_ELEM(right, uchar, j + y, (i + x + disp) * 3 + 1));
                                        CV_IMAGE_ELEM(ret[disp], float, j + y, i + x) += abs(CV_IMAGE_ELEM(right, uchar, center.y, (center.x + disp) * 3 + 2)
                                                - CV_IMAGE_ELEM(right, uchar, j + y, (i + x + disp) * 3 + 2));
                                    }
    // distance
                                    CV_IMAGE_ELEM(ret[disp], float, j + y, i + x) += sqrtf((center.x - (i + x)) * (center.x - (i + x)) + (center.y - (j + y)) * (center.y - (j + y)));
                        }
                    }
                }
    Donc je calcule bien les difference de couleur et la distance comme indique dans l'algorithme.
    Au final j'obtiens une image assez sale compare a ce que je devrais obtenir.

    Je sais que j'ai peu de chance d'avoir une réponse car il faut qu'une personne ai étudié cette algorithme pour pouvoir répondre, mais on ne sait jamais.

    Merci.

  2. #2
    Expert confirmé

    Profil pro
    Inscrit en
    Janvier 2007
    Messages
    10 610
    Détails du profil
    Informations personnelles :
    Âge : 68
    Localisation : France

    Informations forums :
    Inscription : Janvier 2007
    Messages : 10 610
    Billets dans le blog
    2
    Par défaut
    Citation Envoyé par saturn1 Voir le message
    Je sais que j'ai peu de chance d'avoir une réponse car il faut qu'une personne ai étudié cette algorithme pour pouvoir répondre, mais on ne sait jamais.
    ben, c'est surtout que tu ne poses pas de questions Il est donc difficile de donner une réponse à une question inexistante...

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo