Exemplo n.º 1
0
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();

}
Exemplo n.º 2
0
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();
}
Exemplo n.º 3
0
void MainWindow::StitchImages()
{
    Stitch(m_InImage1, m_InImage2, m_Hom, m_HomInv, m_StitchedImage);

    ui->tabWidget->setCurrentIndex(2);
    DrawDisplayImage();
}
Exemplo n.º 4
0
void MainWindow::FirstDerivImage()
{
    double sigma = ui->firstDerivSpinBox->value();

    FirstDerivImage(&outImage, sigma);

    DrawDisplayImage();
}
Exemplo n.º 5
0
void MainWindow::SecondDerivImage()
{
    double sigma = ui->secondDerivSpinBox->value();

    SecondDerivImage(&outImage, sigma);

    DrawDisplayImage();
}
Exemplo n.º 6
0
void MainWindow::HistogramSeedImage()
{
     int num_clusters = ui->clusterBox->value();

     HistogramSeedImage(&outImage, num_clusters);

    DrawDisplayImage();
}
Exemplo n.º 7
0
void MainWindow::PixelSeedImage()
{
     int num_clusters = ui->clusterBox->value();

     PixelSeedImage(&outImage, num_clusters);

    DrawDisplayImage();
}
Exemplo n.º 8
0
void MainWindow::RotateImage()
{
    double orien = ui->orientationSpinBox->value();

    RotateImage(&outImage, orien);

    DrawDisplayImage();
}
Exemplo n.º 9
0
void MainWindow::FindPeaksImage()
{
    double thres = ui->peakThresholdSpinBox->value();

    FindPeaksImage(&outImage, thres);

    DrawDisplayImage();
}
Exemplo n.º 10
0
void MainWindow::MedianImage()
{
    int radius = ui->meanBox->value();

    MedianImage(&outImage, radius);

    DrawDisplayImage();
}
Exemplo n.º 11
0
void MainWindow::AddNoise()
{
    double mag = ui->noiseSpinBox->value();

    AddNoise(&outImage, mag, ui->colorNoiseCheckBox->isChecked());

    DrawDisplayImage();
}
Exemplo n.º 12
0
void MainWindow::BilateralImage()
{
    double sigmaS = ui->bilateralSigmaSSpinBox->value();
    double sigmaI = ui->bilateralSigmaISpinBox->value();

    BilateralImage(&outImage, sigmaS, sigmaI);

    DrawDisplayImage();
}
Exemplo n.º 13
0
void MainWindow::SharpenImage()
{
    double sigma = ui->sharpenSigmaSpinBox->value();
    double mag = ui->sharpenMagSpinBox->value();

    SharpenImage(&outImage, sigma, mag);

    DrawDisplayImage();
}
Exemplo n.º 14
0
void MainWindow::HalfImage()
{
    HalfImage(outImage);

    xScroll = (double) outImage.width()/2.0;
    yScroll = (double) outImage.height()/2.0;
    ui->zoomSlider->setValue(1);

    DrawDisplayImage();
}
Exemplo n.º 15
0
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();
}
Exemplo n.º 16
0
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();
}
Exemplo n.º 17
0
void MainWindow::GaussianBlurImage()
{
    double sigma = ui->blurSpinBox->value();

    if(ui->separableCheckBox->isChecked())
        SeparableGaussianBlurImage(&outImage, sigma);
    else
        GaussianBlurImage(&outImage, sigma);

    DrawDisplayImage();
}
Exemplo n.º 18
0
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();
}
Exemplo n.º 19
0
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();
}
Exemplo n.º 20
0
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();

}
Exemplo n.º 21
0
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();
}
Exemplo n.º 22
0
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();

    }
Exemplo n.º 23
0
void MainWindow::CrazyImage()
{
    CrazyImage(&outImage);

    DrawDisplayImage();
}
Exemplo n.º 24
0
void MainWindow::HoughImage()
{
    HoughImage(&outImage);

    DrawDisplayImage();
}
Exemplo n.º 25
0
void MainWindow::BlackWhiteImage()
{
    BlackWhiteImage(&outImage);

    DrawDisplayImage();
}
Exemplo n.º 26
0
void MainWindow::SobelImage()
{
    SobelImage(&outImage);

    DrawDisplayImage();
}
Exemplo n.º 27
0
void MainWindow::Brightness(int val)
{
    DrawDisplayImage();
}
Exemplo n.º 28
0
void MainWindow::ToggleImage()
{
    DrawDisplayImage();
}