Partage
  • Partager sur Facebook
  • Partager sur Twitter

Erreur avec opencv sur Qt creator

Sujet résolu
    10 avril 2019 à 19:16:15

    Bonjour à tous,

    voici mon problème, je pensais avoir résolu tout mes problème avec opencv sur Qt, mais.... en testant sur un petit programme, cela ne marche pas....

    lorsque je compile mon programme, il me dit qu'il ne trouve pas les fichier .dll, pourtant j'ai vérifié le chemin, il est bon. Est ce que j'ai oublié une étape?

    voici le code de mon fichier .pro:

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = test2
    TEMPLATE = app
    
    INCLUDEPATH += C:\RDF_repo\include
    
    LIBS += C:\RDF_repo\bin\opencv_core401
    LIBS += C:\RDF_repo\bin\opencv_highgui401
    LIBS += C:\RDF_repo\bin\opencv_imgcodecs401
    LIBS += C:\RDF_repo\bin\opencv_calib3d401
    
    
    # The following define makes your compiler emit warnings if you use
    # any feature of Qt which has been marked as deprecated (the exact warnings
    # depend on your compiler). Please consult the documentation of the
    # deprecated API in order to know how to port your code away from it.
    DEFINES += QT_DEPRECATED_WARNINGS
    
    # You can also make your code fail to compile if you use deprecated APIs.
    # In order to do so, uncomment the following line.
    # You can also select to disable deprecated APIs only up to a certain version of Qt.
    #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0
    
    CONFIG += c++11
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp
    
    HEADERS += \
            mainwindow.h
    
    FORMS += \
            mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    


    le code de mon fichier main.cpp:

    #include <iostream>
    
    #include <opencv2/opencv.hpp>
    #include <opencv2/imgproc.hpp>
    #include <opencv2/highgui.hpp>
    
    using namespace std;
    using namespace  cv;
    int main()
    {
        Mat image;
        char keyPress;
        cout << "Welcome to Qt\n";
    
        // Read Image
        image = imread("D:\\QtOpenCV.jpg", IMREAD_COLOR );
        // Show Image
        imshow("OpenCv and Qt", image);
        while(1)
        {
            keyPress = waitKey();
            // Press q key to Close Window
            if (keyPress == 'q')
            {
                destroyAllWindows();
                break;
            }
        }
        return 0;
    }
    

    et voici mon fichier avec tout mes fichier .dll (avec le chemin) :

    et enfin, le problème avec l'erreur :

    Un grand merci pour votre aide,

    Cordialement,

    Paul

    • Partager sur Facebook
    • Partager sur Twitter

    Erreur avec opencv sur Qt creator

    × Après avoir cliqué sur "Répondre" vous serez invité à vous connecter pour que votre message soit publié.
    × Attention, ce sujet est très ancien. Le déterrer n'est pas forcément approprié. Nous te conseillons de créer un nouveau sujet pour poser ta question.
    • Editeur
    • Markdown