Пример #1
0
void MainWindow::crop(QRect rect)
{
  int index = ui->imagesTabWidget->currentIndex();
  QString name = ui->imagesTabWidget->tabText(index);

  if (rect.width() != 0 && rect.height() != 0) {
    cv::Rect roi(rect.x(), rect.y(), rect.width(), rect.height());
    cv::Mat mat = workingImage->current(roi);

    Image* newImage = new Image(mat, this);
    images.push_back(newImage);

    ui->imagesTabWidget->insertTab(++index, newImage, name + " (crop)");
  }

  enableAllTabs();
  enableAllOperations();

  disconnect(workingImage,  SIGNAL(rectangleSelected(QRect)),
             this,          SLOT(crop(QRect)));

  disconnect(workingImage,  SIGNAL(status(QString)),
             ui->statusBar, SLOT(showMessage(QString)));

  ui->statusBar->clearMessage();
}
Пример #2
0
 void SetupTab::onInitFinished()
 {
     emit enableAllTabs(false);
     ui->btnConfig->setEnabled(true);
     ui->btnInit->setEnabled(true);
     ui->btnLoad->setEnabled(true);
     ui->btnLoadCustom->setEnabled(true);
 }
Пример #3
0
 void SetupTab::on_btnLoad_clicked()
 {
     emit enableAllTabs(false);
     emit onBtnLoad();
     emit onBtnLoadSettingsClicked(isCbc2Checked());
     ui->btnInit->setEnabled(true);
     ui->btnConfig->setEnabled(false);
 }
Пример #4
0
 void SetupTab::on_btnInit_clicked()
 {
     emit enableAllTabs(false);
     ui->btnInit->setEnabled(false);
     ui->btnLoad->setEnabled(false);
     ui->btnLoad->setEnabled(false);
     ui->btnConfig->setEnabled(false);
     emit onBtnInitClicked();
 }
Пример #5
0
void MainWindow::finishMeasuring()
{
  enableAllTabs();
  enableAllOperations();

  ui->statusBar->clearMessage();

  disconnect(workingImage,  SIGNAL(status(QString)),
             ui->statusBar, SLOT(showMessage(QString)));

  disconnect(workingImage,  SIGNAL(exitSelectionMode()),
             this,          SLOT(finishMeasuring()));
}
Пример #6
0
void MainWindow::on_actionCanny_triggered()
{
  if (workingImage) {
    if (workingImage->current.channels() == 1) {
      disableOtherTabs();
      setOperationsEnabled(false);

      cannyWindow = new CannyWindow(workingImage, this);

      connect(cannyWindow,  SIGNAL(destroyed()),
              this,         SLOT(enableAllTabs()));

      connect(cannyWindow,  SIGNAL(destroyed()),
              this,         SLOT(enableAllOperations()));
    }
  }
}
Пример #7
0
void MainWindow::on_actionSet_Scale_triggered()
{
  if (workingImage) {
    disableOtherTabs();
    setOperationsEnabled(false);

    setScaleWindow = new SetScaleWindow(workingImage, this);

    connect(workingImage,   SIGNAL(status(QString)),
            ui->statusBar,  SLOT(showMessage(QString)));

    connect(setScaleWindow, SIGNAL(destroyed()),
            this,           SLOT(releaseStatusBar()));

    connect(setScaleWindow, SIGNAL(destroyed()),
            this,           SLOT(enableAllTabs()));

    connect(setScaleWindow, SIGNAL(destroyed()),
            this,           SLOT(enableAllOperations()));
  }
}