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

Discussion :

configuration OpenCV et Qt4

  1. #1
    Membre à l'essai
    Inscrit en
    Avril 2008
    Messages
    41
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 41
    Points : 21
    Points
    21
    Par défaut configuration OpenCV et Qt4
    Bonjour,
    J'ai installé Qt4 et OpenCV sur windows mais lorsque je compile avec make un programme qui contient des fonctions d'openCV, il m'affiche une erreur,il ne connait pas "cv.h".Alors comment procéder pour pouvoir exécuter un programme qui contient des fonctions d'OpenCV et de Qt?
    Merci d'avance de m'aider.

  2. #2
    Membre expert

    Avatar de IrmatDen
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    1 727
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 1 727
    Points : 3 266
    Points
    3 266
    Par défaut
    Salut,

    Il faut ajouter le répertoire d'include d'OpenCV à l'INCLUDEPATH de ton fichier pro. Ex:
    INCLUDEPATH += . /path/to/opencv/include

  3. #3
    Membre à l'essai
    Inscrit en
    Avril 2008
    Messages
    41
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 41
    Points : 21
    Points
    21
    Par défaut
    ok je vais essayer

  4. #4
    Membre à l'essai
    Inscrit en
    Avril 2008
    Messages
    41
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 41
    Points : 21
    Points
    21
    Par défaut
    Il m'affiche encore la méme erreur.
    voila mon fichier .pro:

    ######################################################################
    # Automatically generated by qmake (2.01a) jeu. 29. mai 10:43:49 2008
    ######################################################################

    TEMPLATE = app
    TARGET =
    DEPENDPATH += C:\Program Files\OpenCV\cv\include
    INCLUDEPATH += .

    # Input
    HEADERS += MinutieDect.h ui_MinutieDect.h
    SOURCES += main.cpp MinutieDect.cpp

  5. #5
    Membre expert

    Avatar de IrmatDen
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    1 727
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 1 727
    Points : 3 266
    Points
    3 266
    Par défaut
    Citation Envoyé par IrmatDen Voir le message
    Salut,

    Il faut ajouter le répertoire d'include d'OpenCV à l'INCLUDEPATH de ton fichier pro. Ex:
    INCLUDEPATH += . /path/to/opencv/include

  6. #6
    Membre à l'essai
    Inscrit en
    Avril 2008
    Messages
    41
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 41
    Points : 21
    Points
    21
    Par défaut
    Salut,
    Merci pour tes réponses mais j'ai encore la même erreur.

  7. #7
    Membre expert

    Avatar de IrmatDen
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    1 727
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 1 727
    Points : 3 266
    Points
    3 266
    Par défaut
    Poste ton .pro actuel stp. (Et vérifie que "cv.h" est bien dans le chemin indiqué aussi )

  8. #8
    Membre à l'essai
    Inscrit en
    Avril 2008
    Messages
    41
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 41
    Points : 21
    Points
    21
    Par défaut
    Bonjour,
    Voici mes fichiers:

    /*******fichier Ui_MinutieDect ***/

    #endif // DETECTIONGQ1784_H

    ifndef DETECTIONGQ1784_H
    #define DETECTIONGQ1784_H

    #include <QtCore/QVariant>
    #include <QtGui/QAction>
    #include <QtGui/QApplication>
    #include <QtGui/QButtonGroup>
    #include <QtGui/QLabel>
    #include <QtGui/QPushButton>
    #include <QtGui/QWidget>

    QT_BEGIN_NAMESPACE

    class Ui_MinutieDect
    {
    public:
    QLabel *pixmapLabel3_2;
    QPushButton *Exit;
    QPushButton *FalseM;
    QLabel *textLabel2;

    void setupUi(QWidget *MinutieDect)
    {
    if (MinutieDect->objectName().isEmpty())
    MinutieDect->setObjectName(QString::fromUtf8("MinutieDect"));
    MinutieDect->resize(410, 355);
    pixmapLabel3_2 = new QLabel(MinutieDect);
    pixmapLabel3_2->setObjectName(QString::fromUtf8("pixmapLabel3_2"));
    pixmapLabel3_2->setGeometry(QRect(110, 40, 171, 221));
    pixmapLabel3_2->setPixmap(QPixmap(QString::fromUtf8("../../a.jpg")));
    pixmapLabel3_2->setScaledContents(true);
    pixmapLabel3_2->setWordWrap(false);
    Exit = new QPushButton(MinutieDect);
    Exit->setObjectName(QString::fromUtf8("Exit"));
    Exit->setGeometry(QRect(240, 280, 101, 30));
    FalseM = new QPushButton(MinutieDect);
    FalseM->setObjectName(QString::fromUtf8("FalseM"));
    FalseM->setGeometry(QRect(49, 280, 111, 30));
    textLabel2 = new QLabel(MinutieDect);
    textLabel2->setObjectName(QString::fromUtf8("textLabel2"));
    textLabel2->setGeometry(QRect(110, -10, 160, 60));
    textLabel2->setWordWrap(false);

    retranslateUi(MinutieDect);
    QObject::connect(Exit, SIGNAL(clicked()), MinutieDect, SLOT(close()));

    QMetaObject::connectSlotsByName(MinutieDect);
    } // setupUi

    void retranslateUi(QWidget *MinutieDect)
    {
    MinutieDect->setWindowTitle(QApplication::translate("MinutieDect", "Minutiae Detection", 0, QApplication::UnicodeUTF8));
    Exit->setText(QApplication::translate("MinutieDect", "Exit", 0, QApplication::UnicodeUTF8));
    FalseM->setText(QApplication::translate("MinutieDect", "Detect False Minutiae", 0, QApplication::UnicodeUTF8));
    textLabel2->setText(QApplication::translate("MinutieDect", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
    "<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
    "p, li { white-space: pre-wrap; }\n"
    "</style></head><body style=\" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">\n"
    "<p align=\"center\" style=\" margin-top:12px; margin-bottom:12px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">Minutiae Detected</p></body></html>", 0, QApplication::UnicodeUTF8));
    Q_UNUSED(MinutieDect);
    } // retranslateUi

    };

    namespace Ui {
    class MinutieDect: public Ui_MinutieDect {};
    } // namespace Ui

    QT_END_NAMESPACE

    #endif // DETECTIONGQ1784_H

    /**** fichier MinutieDect.h****/

    #include "ui_MinutieDect.h"
    #include <QWidget>

    class MinutieDect : public QWidget
    {
    Q_OBJECT

    public:
    MinutieDect (QWidget *parent = 0);

    /*private slots:
    void BinaChoix();*/

    private:
    Ui::MinutieDect ui;
    };
    /***fichier MinutieDect.cpp ***/
    #include <QtGui>
    #include "MinutieDect.h"

    MinutieDect::MinutieDect(QWidget *parent): QWidget(parent)
    {
    ui.setupUi(this);


    }



    /****fichier minutie.pro**/

    TEMPLATE = app
    TARGET =
    DEPENDPATH += .
    INCLUDEPATH += C:\\Program Files\\OpenCV\\cv\\include

    # Input
    HEADERS += MinutieDect.h ui_MinutieDect.h
    SOURCES += main.cpp MinutieDect.cpp


    /**** main.cpp****/

    #include <QApplication>
    #include "MinutieDect.h"

    #include<cv.h>

    int main(int argc, char *argv[])
    {
    IplImage *src=cvLoadImage("C:\Qt\4.4.0\a.jpg",0);
    QApplication app(argc, argv);
    //const char *filname;
    MinutieDect *window = new MinutieDect;

    window->show();
    return app.exec();

    }

  9. #9
    Membre expert

    Avatar de IrmatDen
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    1 727
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 1 727
    Points : 3 266
    Points
    3 266
    Par défaut
    Rah, mais c'est pas possible, lis mes messages 2 fois minimum! De toute évidence tu as survolé mon message concernant l'include puisque tu n'as pas mis le chemin au bon endroit. Maintenant, je t'ai demandé un .pro, tu me balances le code de ton projet, ça rime à rien, fais un petit effort de lecture au moins

  10. #10
    Membre à l'essai
    Inscrit en
    Avril 2008
    Messages
    41
    Détails du profil
    Informations forums :
    Inscription : Avril 2008
    Messages : 41
    Points : 21
    Points
    21
    Par défaut
    non j'ai lu vos messages et j'ai corrigé le .pro et le répertoire C:\Program Files\OpenCV\cv\include contient les .h.

  11. #11
    Membre expert

    Avatar de IrmatDen
    Profil pro
    Inscrit en
    Novembre 2006
    Messages
    1 727
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Novembre 2006
    Messages : 1 727
    Points : 3 266
    Points
    3 266
    Par défaut
    Il y a un problème: il y a un espace dans le chemin.
    Donc il faut entourer l'ensemble du chemin de guillemets.

Discussions similaires

  1. Comment configurer openCV dans code blocks ?
    Par boban31 dans le forum Code::Blocks
    Réponses: 0
    Dernier message: 04/04/2013, 01h33
  2. Installation et Configuration OpenCV sous Dev
    Par Mint Sahara dans le forum C
    Réponses: 1
    Dernier message: 24/12/2011, 07h10
  3. Configurer Code::Blocks pour Qt4.4
    Par theprogrammeur dans le forum Débuter
    Réponses: 4
    Dernier message: 10/06/2009, 14h26
  4. Configuration d'OpenCV avec Visual Studio 2003
    Par engineer_23 dans le forum OpenCV
    Réponses: 1
    Dernier message: 28/07/2007, 08h33

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