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
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
errrrrr.........
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?
you must have forgotten to declare QPainter, most probably header file is not included.
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?
Is it a declaration at all !!public:
QPainter painter();
is it a wrong declaration?
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![]()
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?
Did you debug and check ? are x,y of faceLoc greater than 0 ?
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.
Bookmarks