I use these lines of codes to display the Mat image in a graphicsView in Qt:
scene = new QGraphicsScene(this);
ui->graphicsView->setScene(scene);
scene->addPixmap(QPixmap::fromImage(QImage(image.data,image.cols, image.rows, QImage::Format_RGB888)));
But the image is displayed with a blue mask over it. And the Mat image is shown correctly, when I try to display it with this code:
imshow("image", image);
I don't understand where is the bug.