Reputation: 87
I've a time problem. I have programmed a qt Gui for imageprocessing. For this case it would be relevant to implement blobdectetors for videoprocessing and object tracking. Principally it looks good. It uses with GUI behind processing, grabbing, mser operation and displaying just 0.07 to 0.08 seconds which could be used for a nice framerate over 10 fps.
For that purposes i user Qt 4 - C++, on Suse 12.3. OpenCV 2.4.3 and a laptop webcam. My problem is, that after a short while my program's hanging.
Looking at my system monitor i am seeing that CPU-Power has reached 100 % and a single run uses hard ressources of cpu uses processor for long time (without GUI). I don't understand what is going wrong. Has anybody experiences with that?
TY in advance!
Some Code snippets: MSER Initialisation about GUI:
MSER FtMSERVid( MSERDelta, MSERMinArea, MSERMaxArea,MSERMaxVariation ,MSERMinDiversity);
videoprocessing function
double startTime = clock();
camDev.read(vidImg);
if(vidImg.empty() == true)
{
newLineInText(tr("No data from device"));
timer->stop();
ui->pbPlay->setText(tr(">"));
return;
}
MSERPointsVid.clear();
if(vidImg.channels() > 1)
cvtColor(vidImg, vidImg,CV_BGR2GRAY);
FtMSERVid(vidImg, MSERPointsVid);
Mat showMat = vidImg.clone();
if(showMat.channels() > 1)
{
cvtColor(showMat,showMat,CV_BGR2RGB);
qImg = QImage((uchar*)showMat.data,showMat.cols,showMat.rows,showMat.step,QImage::Format_RGB888);
}
else if(showMat.channels() == 1)
qImg = QImage((uchar*)showMat.data,showMat.cols,showMat.rows,showMat.step,QImage::Format_Indexed8);
ui->lblOrig->setPixmap(QPixmap::fromImage(qImg));
double endTime = clock();
double timeDuration = (endTime - startTime)/CLOCKS_PER_SEC;
if(numVid%10 == 0)
{
framesPS = int(1/timeDuration) - 1;
if(framesPS > 1)
framesPS = 1;
FPSChanged(framesPS);
numVid = 0;
}
Upvotes: 0
Views: 232
Reputation: 87
your hints have helped me to solve a problem. MSER is creating a lot data and i have programmed for displaying that a secondly update into a table, which works independently. So far no problem but it is to much for the table to display all the Points.So it was provided just to fill the hullpoints in the table. I have changed the according vector and then it runs like nothing else.
That i have found out because of your hint to valgrind. I have never needed this before. The threading hints have let me learned much about threading. Thank you for that.
Ingeborg
Upvotes: 1