示例#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();

}
示例#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();
}
示例#3
0
void MainWindow::StitchImages()
{
    Stitch(m_InImage1, m_InImage2, m_Hom, m_HomInv, m_StitchedImage);

    ui->tabWidget->setCurrentIndex(2);
    DrawDisplayImage();
}
示例#4
0
void MainWindow::FirstDerivImage()
{
    double sigma = ui->firstDerivSpinBox->value();

    FirstDerivImage(&outImage, sigma);

    DrawDisplayImage();
}
示例#5
0
void MainWindow::SecondDerivImage()
{
    double sigma = ui->secondDerivSpinBox->value();

    SecondDerivImage(&outImage, sigma);

    DrawDisplayImage();
}
示例#6
0
void MainWindow::HistogramSeedImage()
{
     int num_clusters = ui->clusterBox->value();

     HistogramSeedImage(&outImage, num_clusters);

    DrawDisplayImage();
}
示例#7
0
void MainWindow::PixelSeedImage()
{
     int num_clusters = ui->clusterBox->value();

     PixelSeedImage(&outImage, num_clusters);

    DrawDisplayImage();
}
示例#8
0
void MainWindow::RotateImage()
{
    double orien = ui->orientationSpinBox->value();

    RotateImage(&outImage, orien);

    DrawDisplayImage();
}
示例#9
0
void MainWindow::FindPeaksImage()
{
    double thres = ui->peakThresholdSpinBox->value();

    FindPeaksImage(&outImage, thres);

    DrawDisplayImage();
}
示例#10
0
void MainWindow::MedianImage()
{
    int radius = ui->meanBox->value();

    MedianImage(&outImage, radius);

    DrawDisplayImage();
}
示例#11
0
void MainWindow::AddNoise()
{
    double mag = ui->noiseSpinBox->value();

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

    DrawDisplayImage();
}
示例#12
0
void MainWindow::BilateralImage()
{
    double sigmaS = ui->bilateralSigmaSSpinBox->value();
    double sigmaI = ui->bilateralSigmaISpinBox->value();

    BilateralImage(&outImage, sigmaS, sigmaI);

    DrawDisplayImage();
}
示例#13
0
void MainWindow::SharpenImage()
{
    double sigma = ui->sharpenSigmaSpinBox->value();
    double mag = ui->sharpenMagSpinBox->value();

    SharpenImage(&outImage, sigma, mag);

    DrawDisplayImage();
}
示例#14
0
void MainWindow::HalfImage()
{
    HalfImage(outImage);

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

    DrawDisplayImage();
}
示例#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();
}
示例#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();
}
示例#17
0
void MainWindow::GaussianBlurImage()
{
    double sigma = ui->blurSpinBox->value();

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

    DrawDisplayImage();
}
示例#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();
}
示例#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();
}
示例#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();

}
示例#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();
}
示例#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();

    }
示例#23
0
void MainWindow::CrazyImage()
{
    CrazyImage(&outImage);

    DrawDisplayImage();
}
示例#24
0
void MainWindow::HoughImage()
{
    HoughImage(&outImage);

    DrawDisplayImage();
}
示例#25
0
void MainWindow::BlackWhiteImage()
{
    BlackWhiteImage(&outImage);

    DrawDisplayImage();
}
示例#26
0
void MainWindow::SobelImage()
{
    SobelImage(&outImage);

    DrawDisplayImage();
}
示例#27
0
void MainWindow::Brightness(int val)
{
    DrawDisplayImage();
}
示例#28
0
void MainWindow::ToggleImage()
{
    DrawDisplayImage();
}