相机模块待完善
This commit is contained in:
@@ -44,14 +44,13 @@ void camera::run()
|
||||
while (runFlag)
|
||||
{
|
||||
getCameraImg(camera_mat);
|
||||
if (camera_mat.size() > 0)
|
||||
while(camera_mat.size()>0)
|
||||
{
|
||||
int size = imgQueue.size();
|
||||
for (auto img : camera_mat)
|
||||
{
|
||||
imgQueue.enqueue(img);
|
||||
//emit _backEndController->sendPixmapImageWidgetByIndex(cvMatToQPixMap(img), imgWidgetOri, index);
|
||||
if (lastUpdateTime.elapsed() > 200)
|
||||
if (lastUpdateTime.elapsed() > 200)//显示在界面
|
||||
{
|
||||
lastUpdateTime.start(); // 记录本次更新时间
|
||||
QPixmap pixmap;
|
||||
@@ -62,13 +61,37 @@ void camera::run()
|
||||
pack->index = index;
|
||||
emit S1(pack);
|
||||
}
|
||||
else
|
||||
{
|
||||
showLost++;
|
||||
qDebug() << cameraModulePtr.moduleName << "Lost show";
|
||||
}
|
||||
camera_mat.clear();
|
||||
}
|
||||
|
||||
//防止过大
|
||||
//while (imgQueue.size() > 0)
|
||||
//{
|
||||
// imgQueue.dequeue();
|
||||
//}
|
||||
while (imgQueue.size() > 5)
|
||||
{
|
||||
imgQueue.dequeue();
|
||||
imgLost++;
|
||||
qDebug() << cameraModulePtr.moduleName << "Lost img";
|
||||
}
|
||||
|
||||
getCameraImg(camera_mat);
|
||||
}
|
||||
if (data != nullptr)
|
||||
{
|
||||
data->mutex->lock();
|
||||
int imgCnt = data->imgAmountMin;
|
||||
getCameraImg(camera_mat);
|
||||
while (camera_mat.size() > 0)
|
||||
{
|
||||
for (auto img : camera_mat)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
data->mutex->unlock();
|
||||
}
|
||||
QThread::msleep(100);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user