I am trying to create an application where I am trying to integrate opencv and qt.
I managed successfully to convert a cv::Mat to QImage by using the code below:
This is what i got from here thanks to jose. It helps me to get over this.
To visualize OpenCV image (cv::Mat) in Qt (QImage), you must follow these steps:
cv::cvtColor(imageBGR, imageRGB, CV_BGR2RGB);QImage qImage((uchar*) imageRGB.data, imageRGB.cols, imageRGB.rows, imageRGB.step, QImage::Format_RGB888); Please note the use of QImage::Format. Read the Qt on this issue.