Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. OpenCV and QT cv::imread only problem...
QtWS25 Last Chance

OpenCV and QT cv::imread only problem...

Scheduled Pinned Locked Moved General and Desktop
opencvimread
2 Posts 1 Posters 10.0k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • MarcinXM Offline
    MarcinXM Offline
    MarcinX
    wrote on last edited by MarcinX
    #1

    Dear QT an OpenCV users,
    I have installed with CMake actual OpenCV 3.0.0 on my machine. I'm using QT Creator 5.3 with MinGW 32bit (my OS is Win7 64bit).

    This simple example code is successfully compiled:

    #include <opencv2/opencv.hpp>
    #include <opencv2/highgui/highgui.hpp>
    using namespace cv;
    int main(int argc, char *argv[])
    {
    namedWindow("Output",1);
    Mat output = Mat::zeros(120,350,CV_8UC3);
    putText(output,"Hello World :)", cvPoint(15,70),FONT_HERSHEY_PLAIN,3, cvScalar(0,255,0),4);
    imshow("Output",output);
    waitKey(0);
    return 0;
    }

    It works! So my .pro file, headers, libs, patch etc. should be ok...

    But when I try to use something my own, by adding just one line to this code like this:
    Mat src = imread("C:/test.bmp",1);

    I get the following error during compilation:
    undefined reference to `cv::imread(cv::String const&, int)'

    I don't really know what I'm doing wrong :(
    I have been searching in google etc. People have this issue but they have undefined references with all cv:: functions. I can't understand what is wrong there if my example code works (cv::imshow etc. are works).

    Those libs in my .pro file are not enought? Please, have a look:
    INCLUDEPATH += E://OpenCV//release//install//include
    LIBS += "E:\OpenCV\release\lib\libopencv_core300.dll.a"
    LIBS += "E:\OpenCV\release\lib\libopencv_highgui300.dll.a"
    LIBS += "E:\OpenCV\release\lib\libopencv_imgproc300.dll.a"
    LIBS += "E:\OpenCV\release\lib\libopencv_features2d300.dll.a"
    LIBS += "E:\OpenCV\release\lib\libopencv_calib3d300.dll.a"

    Thanks a lot in advance for any help.

    1 Reply Last reply
    0
    • MarcinXM Offline
      MarcinXM Offline
      MarcinX
      wrote on last edited by
      #2

      Problem is solved thanks to user berak at OpenCV forum.

      For other users who can have this problem solution is as follows:

      some modules have changed in 3.0. to use imread()/imwrite, add:
      LIBS += "E:\OpenCV\release\lib\libopencv_imgcodecs300.dll.a"

      Regards

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved