void MainWindow::OpenImage() { const QString title; QString fileName = QFileDialog::getOpenFileName(this, title); if(ui->tabWidget->currentIndex() == 0) { if (!fileName.isEmpty()) m_InImage1.load(fileName); m_InImage1Display = m_InImage1.copy(); } if(ui->tabWidget->currentIndex() == 1) { if (!fileName.isEmpty()) m_InImage2.load(fileName); m_InImage2Display = m_InImage2.copy(); } DrawDisplayImage(); }
void MainWindow::Scroll(int val) { if(zoomChanged == false) { int zoom = ui->zoomSlider->value()/20 + 1; double c0 = (double) (ui->ImgDisplay->width()/(2*zoom)); double c1 = (double) (outImage.width()) - c0; if(c0 < c1) { double del = (double) ui->horizontalScrollBar->value()/ (double) ui->horizontalScrollBar->maximum(); xScroll = del*(c1 - c0) + c0; } else xScroll = (double) outImage.width()/2.0; double r0 = (double) (ui->ImgDisplay->height()/(2*zoom)); double r1 = (double) (outImage.height()) - r0; if(r0 < r1) { double del = (double) ui->verticalScrollBar->value()/ (double) ui->verticalScrollBar->maximum(); yScroll = del*(r1 - r0) + r0; } else yScroll = (double) outImage.height()/2.0; } zoomChanged = false; DrawDisplayImage(); }
void MainWindow::StitchImages() { Stitch(m_InImage1, m_InImage2, m_Hom, m_HomInv, m_StitchedImage); ui->tabWidget->setCurrentIndex(2); DrawDisplayImage(); }
void MainWindow::FirstDerivImage() { double sigma = ui->firstDerivSpinBox->value(); FirstDerivImage(&outImage, sigma); DrawDisplayImage(); }
void MainWindow::SecondDerivImage() { double sigma = ui->secondDerivSpinBox->value(); SecondDerivImage(&outImage, sigma); DrawDisplayImage(); }
void MainWindow::HistogramSeedImage() { int num_clusters = ui->clusterBox->value(); HistogramSeedImage(&outImage, num_clusters); DrawDisplayImage(); }
void MainWindow::PixelSeedImage() { int num_clusters = ui->clusterBox->value(); PixelSeedImage(&outImage, num_clusters); DrawDisplayImage(); }
void MainWindow::RotateImage() { double orien = ui->orientationSpinBox->value(); RotateImage(&outImage, orien); DrawDisplayImage(); }
void MainWindow::FindPeaksImage() { double thres = ui->peakThresholdSpinBox->value(); FindPeaksImage(&outImage, thres); DrawDisplayImage(); }
void MainWindow::MedianImage() { int radius = ui->meanBox->value(); MedianImage(&outImage, radius); DrawDisplayImage(); }
void MainWindow::AddNoise() { double mag = ui->noiseSpinBox->value(); AddNoise(&outImage, mag, ui->colorNoiseCheckBox->isChecked()); DrawDisplayImage(); }
void MainWindow::BilateralImage() { double sigmaS = ui->bilateralSigmaSSpinBox->value(); double sigmaI = ui->bilateralSigmaISpinBox->value(); BilateralImage(&outImage, sigmaS, sigmaI); DrawDisplayImage(); }
void MainWindow::SharpenImage() { double sigma = ui->sharpenSigmaSpinBox->value(); double mag = ui->sharpenMagSpinBox->value(); SharpenImage(&outImage, sigma, mag); DrawDisplayImage(); }
void MainWindow::HalfImage() { HalfImage(outImage); xScroll = (double) outImage.width()/2.0; yScroll = (double) outImage.height()/2.0; ui->zoomSlider->setValue(1); DrawDisplayImage(); }
void MainWindow::HarrisCornerImage() { double sigma = ui->harrisSpinBox->value(); double thres = ui->harrisThresSpinBox->value(); HarrisCornerDetector(m_InImage1, sigma, thres, &m_IntPts1, m_NumIntPts1, m_InImage1Display); HarrisCornerDetector(m_InImage2, sigma, thres, &m_IntPts2, m_NumIntPts2, m_InImage2Display); DrawDisplayImage(); }
void MainWindow::MatchImages() { m_InImage1Display = m_InImage1.copy(); m_InImage2Display = m_InImage2.copy(); MatchInterestPoints(m_InImage1, m_IntPts1, m_NumIntPts1, m_InImage2, m_IntPts2, m_NumIntPts2, &m_Matches, m_NumMatches, m_InImage1Display, m_InImage2Display); DrawDisplayImage(); }
void MainWindow::GaussianBlurImage() { double sigma = ui->blurSpinBox->value(); if(ui->separableCheckBox->isChecked()) SeparableGaussianBlurImage(&outImage, sigma); else GaussianBlurImage(&outImage, sigma); DrawDisplayImage(); }
void MainWindow::RANSAC() { int numIterations = ui->iterationsBox->value(); double inlierThreshold = ui->RANSACThresSpinBox->value(); m_InImage1Display = m_InImage1.copy(); m_InImage2Display = m_InImage2.copy(); RANSAC(m_Matches, m_NumMatches, numIterations, inlierThreshold, m_Hom, m_HomInv, m_InImage1Display, m_InImage2Display); DrawDisplayImage(); }
void MainWindow::ResetImage() { int w = outImage.width(); outImage = inImage.copy(); if(w != outImage.width()) { xScroll = (double) outImage.width()/2.0; yScroll = (double) outImage.height()/2.0; ui->zoomSlider->setValue(1); } DrawDisplayImage(); }
void MainWindow::OpenImage() { const QString title; QString fileName = QFileDialog::getOpenFileName(this, title); if (!fileName.isEmpty()) inImage.load(fileName); outImage = inImage.copy(); xScroll = (double) outImage.width()/2.0; yScroll = (double) outImage.height()/2.0; ui->zoomSlider->setValue(0); DrawDisplayImage(); }
void MainWindow::Zoom(int val) { int zoom = val/20 + 1; double c0 = (double) (ui->ImgDisplay->width()/(2*zoom)); double c1 = (double) (outImage.width()) - c0; if(c0 < c1) { xScroll = min(c1, max(c0, xScroll)); double newScrollX = (xScroll - c0)/(c1 - c0); newScrollX *= (double) ui->horizontalScrollBar->maximum(); zoomChanged = true; ui->horizontalScrollBar->setVisible(true); ui->horizontalScrollBar->setValue((int) newScrollX); } else { xScroll = (double) outImage.width()/2.0; ui->horizontalScrollBar->setVisible(false); } double r0 = (double) (ui->ImgDisplay->height()/(2*zoom)); double r1 = (double) (outImage.height()) - r0; if(r0 < r1) { yScroll = min(r1, max(r0, yScroll)); double newScrollY = (yScroll - r0)/(r1 - r0); newScrollY *= (double) ui->verticalScrollBar->maximum(); zoomChanged = true; ui->verticalScrollBar->setVisible(true); ui->verticalScrollBar->setValue((int) newScrollY); } else { yScroll = (double) outImage.height()/2.0; ui->verticalScrollBar->setVisible(false); } DrawDisplayImage(); }
void MainWindow::Open() { const QString title; int minDisparity = 0; int maxDisparity = 0; QString fileName = QFileDialog::getOpenFileName(this, title); if (!fileName.isEmpty()) { QFile file(fileName); if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) return; QTextStream in(&file); QString imageName; QString directoryName = fileName; directoryName.remove(directoryName.lastIndexOf('/') + 1, directoryName.length()); in >> imageName; m_InImage1.load(directoryName + imageName); m_DisplayImage1 = m_InImage1.copy(); in >> imageName; m_InImage2.load(directoryName + imageName); m_DisplayImage2 = m_InImage2.copy(); in >> imageName; if(!imageName.isEmpty()) { m_GTDisplayImage.load(directoryName + imageName); } in >> minDisparity; in >> maxDisparity; in >> m_DisparityScale; DrawDisplayImage(); }
void MainWindow::CrazyImage() { CrazyImage(&outImage); DrawDisplayImage(); }
void MainWindow::HoughImage() { HoughImage(&outImage); DrawDisplayImage(); }
void MainWindow::BlackWhiteImage() { BlackWhiteImage(&outImage); DrawDisplayImage(); }
void MainWindow::SobelImage() { SobelImage(&outImage); DrawDisplayImage(); }
void MainWindow::Brightness(int val) { DrawDisplayImage(); }
void MainWindow::ToggleImage() { DrawDisplayImage(); }