Results 1 to 4 of 4

Thread: New in opencv2.3.1 and Qt

  1. #1
    Join Date
    Sep 2009
    Posts
    31
    Thanks
    7
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: New in opencv2.3.1 and Qt

    Hello friends,

    I decided to work with Qt more opencv,
    I using the book "OpenCV 2 Computer Vision Application Programming Cookbook", and followed this tutorial:
    http://knowtheabc.wordpress.com/2011...nd-qt-creator/

    My code is:
    (.pro)
    Qt Code:
    1. INCLUDEPATH += C:/opencv/build/include/
    2.  
    3. LIBS += "C:/opencv/build/lib/libopencv_core231.dll.a" \
    4. "C:/opencv/build/lib/libopencv_highgui231.dll.a" \
    5. "C:/opencv/build/lib/libopencv_imgproc231.dll.a" \
    6. "C:/opencv/build/lib/libopencv_features2d231.dll.a" \
    7. "C:/opencv/build/lib/libopencv_calib3d231.dll.a"
    To copy to clipboard, switch view to plain text mode 

    (.cpp)
    Qt Code:
    1. #include <opencv2/core/core.hpp>
    2. #include <opencv2/highgui/highgui.hpp>
    3.  
    4. int main()
    5. {
    6. cv::Mat imagem = cv::imread("C:/lena.jpg");
    7. cv::namedWindow("Teste");
    8. cv::imshow("Teste", imagem);
    9. cv::waitKey(5000);
    10.  
    11. return 1;
    12. }
    To copy to clipboard, switch view to plain text mode 



    the output is:
    "Press <RETURN> to close this window..."
    and nothing more.

    Making test with stdio and printf I can only print on the screen before of the
    my code (just the beginning of the main). If after the code, nothing appears.
    (just "Press <RETURN> (...)").

    I had enough sense to put the .dll along with the .exe, and also to put the
    image in the correct directory.

    I tried in my (.pro):
    Qt Code:
    1. INCLUDEPATH += C:/opencv/build/include/
    2.  
    3. LIBS += C:/opencv/build/bin/*.dll
    To copy to clipboard, switch view to plain text mode 
    but nothing.

    In Qt GUI, the window does not open when I use any function opencv.

    I hope some help.
    Sorry my english.

    .,


    Added after 25 minutes:


    I discovered the error.
    I was making two errors.

    I did not copy all the dlls required:
    QtOpenGL4.dll, QtTest4.dll, ...

    And I was copying the dll of the opencv the wrong path. Path correct is (<buld path>/bin/*.dll).
    Last edited by danilodsp; 28th October 2011 at 00:29.

  2. The following user says thank you to danilodsp for this useful post:

    niki_1989 (18th November 2012)

  3. #2
    Join Date
    Nov 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: New in opencv2.3.1 and Qt

    try this path for the image:
    "C://lena.jpg"

    if this doesnt help then try using some image on the desktop because sometimes the OS (mostly windows) does not allow permissions to access data in c drive.

  4. #3
    Join Date
    Nov 2012
    Posts
    1
    Thanks
    1

    Default Re: New in opencv2.3.1 and Qt

    Hi ... I have this problem too .. and i don't know how can i solve it !!! I can't understand how to fixed ..
    F1 (help) me please !!

  5. #4
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: New in opencv2.3.1 and Qt

    Which problem?

Similar Threads

  1. Pb to install opencv2.3 under Qt
    By harold4 in forum Newbie
    Replies: 5
    Last Post: 12th August 2011, 15:13
  2. opencv2.2 webcam
    By afro_cv in forum Qt Programming
    Replies: 3
    Last Post: 8th August 2011, 07:49
  3. OpenCV2.1 and Qt 4.7.4 integration
    By nackasha in forum Newbie
    Replies: 1
    Last Post: 20th July 2011, 23:31
  4. Replies: 0
    Last Post: 12th March 2011, 19:46

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.