How can we convert directly cv::Mat to QPixmap without going through filename loading?
I have made some research about it but no hints!
As a first step, what I have tried is that I save the image, and then load it. But it's not what I want to have.
Jehan is right.
For people referring to this thread in the future: First convert image from BGR(used by OpenCV) to RGB.
Then:
QPixmap::fromImage(QImage((unsigned char*) mat.data, mat.cols, mat.rows, QImage::Format_RGB888));