1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| _loopTimer.stop();
QList<Mat*> myimgROS;
Mat curFrame;
bool bStatus = _capt->grab();
_capt->retrieve(curFrame);
if (bStatus)
{
cvtColor(curFrame, curFrame, CV_BGR2RGB);
_frame = curFrame.clone();
//Sauvegarde des échantillons
for(int i =0;i<lsRect.count();i+=1)
{
Point p1 = Point(lsRect.at(i)->x,lsRect.at(i)->y);
Point p2 = Point(lsRect.at(i)->x+lsRect.at(i)->width,lsRect.at(i)->y+lsRect.at(i)->height);
myimgROS << new Mat(_frame,Rect(lsRect.at(i)->x,lsRect.at(i)->y,lsRect.at(i)->width,lsRect.at(i)->height));
}
//Affichage de l'image acquise
QPixmap pm;
pm.convertFromImage(QImage((uchar*)curFrame.data, curFrame.cols, curFrame.rows,QImage::Format_RGB888));
this->setPixmap(pm);
}
//Envoie de la QList<QMat*>
//Clean QList
myimgROS.clear();
_loopTimer.start(); |
Partager