PDA

View Full Version : need help to start qt opencv



hatred
8th June 2010, 17:05
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

tbscope
8th June 2010, 17:25
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.

hatred
8th June 2010, 17:51
errrrrr.........

tbscope
8th June 2010, 18:05
errrrrr.........

You should learn to ask smart questions.

hatred
14th June 2010, 16:08
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?

Onanymous
14th June 2010, 16:37
you must have forgotten to declare QPainter, most probably header file is not included.

hatred
15th June 2010, 03:18
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?

aamer4yu
15th June 2010, 07:29
public:

QPainter painter();

is it a wrong declaration?

Is it a declaration at all !! :confused:

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 :)

hatred
17th June 2010, 06:02
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::paintEvent(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?

aamer4yu
17th June 2010, 07:10
Did you debug and check ? are x,y of faceLoc greater than 0 ?

hatred
17th June 2010, 08:29
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?