Results 1 to 11 of 11

Thread: need help to start qt opencv

  1. #1
    Join Date
    Jun 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default need help to start qt opencv

    hello im currently working on a project to program a facedetection using qt and opencv.
    could anyone help me?
    i need working source code for qt

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: need help to start qt opencv

    Quote Originally Posted by hatred View Post
    hello im currently working on a project to program a facedetection using qt and opencv.
    could anyone help me?
    i need working source code for qt
    I need one million euros or dollars.

  3. #3
    Join Date
    Jun 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: need help to start qt opencv

    errrrrr.........

  4. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: need help to start qt opencv

    Quote Originally Posted by hatred View Post
    errrrrr.........
    You should learn to ask smart questions.
    Last edited by tbscope; 8th June 2010 at 19:52. Reason: removed sexist comment

  5. #5
    Join Date
    Jun 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: need help to start qt opencv

    im trying to make a rectangle according to some point , my source code is this

    QRectF rectangle(10.0, 20.0, 80.0, 60.0);

    QPainter painter(this);
    if(faceLoc.x()>0 & faceLoc.y()>0)
    {
    painter.drawRect(QRect(faceLoc.x(),faceLoc.y(),fac eLoc.width(),faceLoc.height()));
    }

    but i got and error messages

    C:/Users/Steven/Desktop/QtOpenCV/MyCameraWindow.cpp:89: error: variable 'QPainter painter' has initializer but incomplete type
    can anyone help me?

  6. #6
    Join Date
    May 2010
    Posts
    23
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: need help to start qt opencv

    you must have forgotten to declare QPainter, most probably header file is not included.

  7. #7
    Join Date
    Jun 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: need help to start qt opencv

    i already include the header file and declare the Qpainter, but the same error is still there

    my declaration of the Qpainter is:

    public:

    QPainter painter();

    is it a wrong declaration?

  8. #8
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: need help to start qt opencv

    public:

    QPainter painter();

    is it a wrong declaration?
    Is it a declaration at all !!

    it says there is a function painter() with return type QPainter !

    you include headers with pre processor includes-
    #include <QPainter>

    if you are not familiar with C++, first get yourself acquainted with it

  9. #9
    Join Date
    Jun 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: need help to start qt opencv

    now im trying to add my .h files with this code:

    private:

    QPen pen;
    QBrush brush;

    protected:
    void paintEvent(QPaintEvent *event);

    after that i tried to call the function to draw a rectangular arround the faces with this source code:

    void MyCameraWindow:aintEvent(QPaintEvent* event) {
    QPainter painter(this);

    painter.drawImage(QPoint(),m_i);

    if(faceLoc.x() > 0 && faceLoc.y() > 0) {
    painter.setBrush(Qt::NoBrush);
    painter.setPen(QColor(255,0,0));
    painter.drawRect(QRect(faceLoc.x(),faceLoc.y(),fac eLoc.width(),faceLoc.height()));
    }
    }

    it was compiled just fine without error, but the result window doesnt show any rectangular arround the face.
    does anyone know how to solve it?

  10. #10
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: need help to start qt opencv

    Did you debug and check ? are x,y of faceLoc greater than 0 ?

  11. #11
    Join Date
    Jun 2010
    Posts
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: need help to start qt opencv

    its solved, i used another program that takes the drawing from opencv, thanx btw.
    this is the program:

    CvRect* r = (CvRect*)cvGetSeqElem( faces, i );
    CvPoint center;
    int ra;
    center.x = cvRound((r->x + r->width*0.5)*scale);
    center.y = cvRound((r->y + r->height*0.5)*scale);
    ra =cvRound((r->width + r->height)*0.25*scale);
    printf("ini center x= %c \n",center.x);
    printf("ini center y= %c \n",center.y);

    //the window size is 640x480

    cvRectangle( img, cvPoint(center.x-ra,center.y-ra), cvPoint(center.x+ra,center.y+ra), colors[i%8], 2, 8, 0 );


    does anyone know how to see the result of the printf thing?

    and the other problem is:
    i need to send the coordinates from my qt application to a microncontroller,

    so i need to send the value of the center coordinates to the microcontroller so it can be processed,
    the value send is:

    center.x
    center.y

    im currently using microcrontroller atmega8535, and i dont have any idea, how to interface my micro controller with my qt program.

    anyone can help?
    Last edited by hatred; 17th June 2010 at 07:44.

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. OpenCv + Qt
    By Janderson Borges in forum Qt Programming
    Replies: 3
    Last Post: 2nd December 2008, 13:01

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.