Results 1 to 7 of 7

Thread: Trying to use OpenCV

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

    Default Re: Trying to use OpenCV

    Hello,

    I am trying to use OpenCV for the first time. I'm not getting.

    I'm following in the steps of the forum comments here.

    My .pro:
    Qt Code:
    1. QT += core
    2.  
    3. QT -= gui
    4.  
    5. TARGET = vision
    6. CONFIG += console
    7. CONFIG -= app_bundle
    8.  
    9. TEMPLATE = app
    10.  
    11. SOURCES += main.cpp
    12.  
    13. INCLUDEPATH += E:/OpenCV2.3/opencv/modules/core/include \
    14. E:/OpenCV2.3/opencv/modules/highgui/include
    15.  
    16. LIBS += -L"E:/OpenCV2.3/build/x64/mingw/bin"
    17. LIBS += -lopencv_core230 -lopencv_highgui230
    To copy to clipboard, switch view to plain text mode 

    My main.cpp:
    Qt Code:
    1. #include <QtCore/QCoreApplication>
    2.  
    3. #include <opencv2/highgui/highgui.hpp>
    4. #include <opencv2/core/core.hpp>
    5.  
    6. int main(int argc, char *argv[])
    7. {
    8. cv::Mat image = cv::imread("C:\teste.jpg");
    9. cv::namedWindow("My Image");
    10. cv::imshow("My Image", image);
    11. cv::waitKey(-1);
    12. return 0;
    13. }
    To copy to clipboard, switch view to plain text mode 

    The following error occurs when you make the release:
    E:/OpenCV2.3/build/x64/mingw/bin/libopencv_core230.dll: file not recognized: File format not recognized
    collect2: ld returned 1 exit status
    make[1]: *** [debug\vision.exe] Error 1
    make[1]: Leaving directory `C:/Users/Danilo Pena/Meus Programas Qt/CV/vision'
    make: *** [debug] Error 2

    always this occurs:
    E:/OpenCV2.3/build/x64/mingw/bin/libopencv_core230.dll: file not recognized: File format not recognized

    My OpenCV installed on:
    E:/OpenCV2.3/


    Thanks.


    Added after 1 22 minutes:


    I had forgotten to make mingw32-make.
    Error continues.

    My .pro:
    Qt Code:
    1. QT += core
    2.  
    3. QT -= gui
    4.  
    5. TARGET = vision
    6. CONFIG += console
    7. CONFIG -= app_bundle
    8.  
    9. TEMPLATE = app
    10.  
    11. SOURCES += main.cpp
    12.  
    13. INCLUDEPATH += E:/OpenCV2.3/opencv/modules/core/include \
    14. E:/OpenCV2.3/opencv/modules/highgui/include
    15.  
    16. LIBS += "E:\OpenCV2.3\build\lib\libopencv_core230.dll.a" \
    17. LIBS "E:\OpenCV2.3\build\lib\libopencv_highgui230.dll.a"
    To copy to clipboard, switch view to plain text mode 

    New erro:
    Qt Code:
    1. :: error: LIBS: No such file or directory
    To copy to clipboard, switch view to plain text mode 
    Last edited by danilodsp; 10th August 2011 at 09:07.

  2. #2
    Join Date
    Aug 2011
    Location
    Seoul, Korea
    Posts
    46
    Thanks
    9
    Thanked 5 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Trying to use OpenCV

    I have few questions to answer your question. =)

    - is it 64bit or 32bit OS? Do you have correct version of libraries (i.e. mingw, Qt and OpenCV are based on the same bit system)
    - Can you really find E:\OpenCV2.3\build\lib\libopencv_core230.dll.a and E:\OpenCV2.3\build\lib\libopencv_highgui230.dll.a?
    - Line 17 "LIBS "E:\OpenCV2.3\build\lib\libopencv_highgui230.dll.a ", I think you should remove "LIBS" in the beginning. It's syntax error
    Dong Back Kim

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

    Default Re: Trying to use OpenCV

    Thanks!

    Quote Originally Posted by Dong Back Kim View Post
    I have few questions to answer your question. =)

    - is it 64bit or 32bit OS? Do you have correct version of libraries (i.e. mingw, Qt and OpenCV are based on the same bit system)
    - Can you really find E:\OpenCV2.3\build\lib\libopencv_core230.dll.a and E:\OpenCV2.3\build\lib\libopencv_highgui230.dll.a?
    - Line 17 "LIBS "E:\OpenCV2.3\build\lib\libopencv_highgui230.dll.a ", I think you should remove "LIBS" in the beginning. It's syntax error
    1. Yes, my system it's ok, 64bits.
    2. Yes.
    3. I corrected, is now working.

    New problem,

    The program window does not open:
    Starting C:\Users\Danilo Pena\Meus Programas Qt\CV\visao-build-desktop\release\visao.exe...
    C:\Users\Danilo Pena\Meus Programas Qt\CV\visao-build-desktop\release\visao.exe exited with code -1073741511

    It only works if I remove part of the code opencv.

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

    Default Re: Trying to use OpenCV

    I'm using Qt4, OpenCV2.3 and gcc4.3.3 on Windows.

    I do not know the meaning of:
    exited with code -1073741511

  5. #5
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Trying to use OpenCV

    I do not know the meaning of:
    exited with code -1073741511
    Download Err.exe
    Qt Code:
    1. Err.exe -1073741511
    2. # for decimal -1073741511 / hex 0xc0000139 :
    3. STATUS_ENTRYPOINT_NOT_FOUND ntstatus.h
    4. # {Entry Point Not Found}
    5. # The procedure entry point %hs could not be located in the
    6. # dynamic link library %hs.
    To copy to clipboard, switch view to plain text mode 
    Try putting the linked libraries (exactly those!) in your app.exe directory, now it looks like wrong version of library is used when you launch the app.

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

    Default Re: Trying to use OpenCV

    Hi stampede,

    I saw this in another comment. I put the dll in the folder of the release and does not work.

    My include:
    Qt Code:
    1. #include <QMainWindow>
    2. #include <opencv2/core/core.hpp>
    3. #include <opencv2/highgui/highgui.hpp>
    To copy to clipboard, switch view to plain text mode 

    Error also occurs when I make "qmake && make":
    (...)
    c:\Qt\2010.05\qt\lib/libqtmaind.a(qtmain_win.o):qtmain_win.cpp.eh_frame+0x12):
    undefined reference to `__gxx_personality_v0'
    collect2: ld returned 1 exit status
    make[1]: *** [debug\compv.exe] Error 1
    make[1]: Leaving directory `C:/Users/Danilo Pena/Meus Programas Qt/Computer Visi
    on/compv'

    make: *** [debug] Error 2

  7. #7
    Join Date
    Aug 2011
    Location
    Sydney, Australia
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Question Re: Trying to use OpenCV

    Did you manage to resolve the issue?
    I have the same problem.
    Do I need to recompile the OpenCV with qt and use my own reproduced dlls?

Similar Threads

  1. OpenCV on mac
    By sandeep_hyd123 in forum Newbie
    Replies: 1
    Last Post: 17th June 2011, 04:53
  2. opencv-qt-mac
    By ireneluis in forum Qt Programming
    Replies: 0
    Last Post: 16th March 2010, 15:24
  3. Qt and OpenCV
    By malorie in forum Newbie
    Replies: 2
    Last Post: 7th March 2010, 14:57
  4. OpenCv & Qt4
    By switch in forum Qt Programming
    Replies: 0
    Last Post: 4th August 2009, 15:12
  5. JAI vs. OpenCV vs. ITK
    By tpieciak in forum General Programming
    Replies: 0
    Last Post: 8th July 2009, 13:45

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.