change stiching method

add camera temperature readout
This commit is contained in:
2021-07-05 11:27:38 +02:00
parent ea3b870c0a
commit 48a04fdf79
10 changed files with 128 additions and 24 deletions

View File

@ -31,9 +31,7 @@ void CameraListWidget::setCameras(const std::vector<cam::Camera::Description>& d
qDebug()<<"cameras: "<<desc_.size();
setRowCount(static_cast<int>(desc_.size()));
for(size_t i = 0; i < desc_.size(); ++i)
{
setItem(static_cast<int>(i), 0, new QTableWidgetItem((desc_[i].getVendor() + " " + desc_[i].getModel()).c_str()));
}
}
std::vector<cam::Camera::Description> CameraListWidget::getSelectedDescriptions()

View File

@ -100,7 +100,6 @@ void CvImageViewer::mousePressEvent(QMouseEvent *event)
}
else
{
sigValue(x, y, 0);
}
}

View File

@ -12,7 +12,7 @@ MainWindow::MainWindow(QWidget *parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
ui->statusbar->showMessage("idle");
ui->statusbar->showMessage("no cameras");
connect(ui->actionQuit, &QAction::triggered, [this](bool checked){(void)checked; close();});
connect(ui->actionCameras, &QAction::triggered, [this](bool checked){(void)checked; sigChooseCameras();});
connect(ui->actionProfile, &QAction::triggered, [this](bool checked){(void)checked; sigEditProfiles();});
@ -32,6 +32,11 @@ void MainWindow::setImageValue(size_t x, size_t y, double value)
ui->lcdNumber->display(value);
}
void MainWindow::setTemperature(double temp)
{
ui->lcdNumber_temp->display(temp);
}
void MainWindow::saveImage()
{
if(!ui->mainViewer->getImage().data)
@ -59,7 +64,16 @@ void MainWindow::openImage()
{
cv::Mat image;
cv::FileStorage matf(fileName.toStdString(), cv::FileStorage::READ);
matf["image"]>>image;
try
{
matf["image"]>>image;
}
catch(const cv::Exception& ex)
{
qDebug()<<ex.what();
QMessageBox::warning(this, "Invalid file", "File selected dose not contain a valid image");
return;
}
if(matf.isOpened() && (!image.data || image.type() != CV_32FC1))
{
@ -75,6 +89,12 @@ void MainWindow::openImage()
}
}
void MainWindow::enableCapture(bool enable)
{
ui->statusbar->showMessage(enable ? "idle" : "cameras not ready" );
ui->pushButtonCapture->setEnabled(enable);
}
void MainWindow::addCamera(std::shared_ptr<Camera> camera)
{
viewers_.push_back(new CvImageViewer(this, camera->id()));

View File

@ -36,6 +36,8 @@ public slots:
bool setProfile(const QString& profileName);
QString getProfileName();
void statusMsg(QString msg);
void enableCapture(bool capture);
void setTemperature(double temp);
public:
MainWindow(QWidget *parent = nullptr);

View File

@ -42,7 +42,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>278</width>
<width>182</width>
<height>483</height>
</rect>
</property>
@ -74,8 +74,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>467</width>
<height>313</height>
<width>563</width>
<height>282</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_6">
@ -152,6 +152,9 @@
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QPushButton" name="pushButtonCapture">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Capture</string>
</property>
@ -180,6 +183,36 @@
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="topMargin">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_temp">
<property name="enabled">
<bool>true</bool>
</property>
<property name="text">
<string>Mean camera temperature [℃]</string>
</property>
</widget>
</item>
<item>
<widget class="QLCDNumber" name="lcdNumber_temp">
<property name="enabled">
<bool>true</bool>
</property>
<property name="value" stdset="0">
<double>0.000000000000000</double>
</property>
<property name="intValue" stdset="0">
<number>0</number>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>