Results 1 to 3 of 3

Thread: Opencv in Qt

  1. #1
    Join Date
    May 2013
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Android

    Smile Opencv in Qt

    Hi friends,
    I have been to call the opencv function from Qt(Qml),but it doesn’t working well…It always showing error(Undefined reference to cvLoadImage,cvNamedWindow,etc.)….But when i run that opencv code in console application means ,it is running well..But when i using it with Qt,it is displaying this error..Could anyone please sought out the problem..
    thanks in advance..

  2. #2
    Join Date
    Mar 2010
    Posts
    77
    Thanks
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Opencv in Qt

    it seems you dont add library of opencv to qt correctly... so google it for your opencv version

  3. #3
    Join Date
    May 2013
    Posts
    28
    Thanks
    8
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Symbian S60 Android

    Default Re: Opencv in Qt

    Hi friends,
    Sorry for the delay sir. I’ve used pro file as
    LIBS += -L/usr/local/lib \
    -lopencv_core \
    -lopencv_imgproc \


    This is what i’m trying. From Qml, i’m calling a function.

    QString mainwindow::get_opencv(QString &get_word)
    {
    IplImage *img2 = cvLoadImage("images_.png");
    CvPoint pt1 = cvPoint(130,90);
    int thickness = 2;
    char text[20];
    char m_framecnt[100]="kannamohan";
    CvScalar blue = CV_RGB(0,0,250);
    double hscale = 1.0;
    double vscale = 1.0;
    double shear = 0;
    //int thickness2 = 1;
    int line_type = 4;
    snprintf(text,sizeof(text), "%s",m_framecnt);
    cvNamedWindow("Window",CV_WINDOW_AUTOSIZE);
    CvFont font1 ;//= fontQt("Times");
    cvInitFont(&font1,CV_FONT_HERSHEY_DUPLEX,hscale,vs cale,shear,thickness,line_type);
    cvPutText(img2,text,pt1,&font1,blue);
    cvShowImage("Window",img2);
    cvWaitKey(0);
    cvReleaseImage(&img2);
    cvDestroyWindow("Window");
    }
    It is telling undefined reference to cvLoadImage,CvPoint,etc.. please help me sir..

Similar Threads

  1. OpenCV + QT4
    By thereisnoknife in forum Qt Programming
    Replies: 6
    Last Post: 8th March 2013, 05:19
  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

Tags for this Thread

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.