Created
February 15, 2018 00:12
-
-
Save esmarr58/9b71baa4de1642062b1c68d6fef2b25a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void MainWindow::on_pushButton_clicked() | |
{ | |
QString nombreImagen = QFileDialog::getOpenFileName(this, tr("Abrir imagen"), "/home/", tr("Imagenes (*.png *.jpg *.bmp)")); | |
IMAGEN = imread(nombreImagen.toUtf8().constData()); | |
//Paso # 1 - Adaptar la imagen a la etiqueta | |
cv::resize(IMAGEN,IMAGENchica,Size(150,150)); | |
//Paso # 2 - Procesar la imagen chica para obtener un desenfoque | |
GaussianBlur(IMAGENchica, ImagenDesenfoque, Size(3,3),0,0,0); | |
//Paso # 3 - Procesar la imagen anterior para obtener HSV | |
//cvtColor(ImagenDesenfoque,ImagenHSV,CV_BGR2HSV); | |
cvtColor(IMAGENchica,ImagenHSV,CV_BGR2HSV); | |
//Paso # 4 - Mostrar las imagenes en sus respectivas etiquetas | |
QImage qImage = Mat2QImage(IMAGENchica); | |
QPixmap pixmap = QPixmap::fromImage(qImage); | |
ui->labelColor->clear(); | |
ui->labelColor->setPixmap(pixmap); | |
qImage = Mat2QImage(ImagenDesenfoque); | |
pixmap = QPixmap::fromImage(qImage); | |
ui->labelGauss->clear(); | |
ui->labelGauss->setPixmap(pixmap); | |
qImage = Mat2QImage(ImagenHSV); | |
pixmap = QPixmap::fromImage(qImage); | |
ui->labelHSV->clear(); | |
ui->labelHSV->setPixmap(pixmap); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment