-
Notifications
You must be signed in to change notification settings - Fork 5
Shuai YUAN edited this page Jan 11, 2018
·
10 revisions
- How to link opencv in QtCreator and use Qt library
- Using OpenCV 3 on Qt Creator 3.2 (Qt 5.3)
- https://wiki.qt.io/OpenCV_with_Qt
- Building OpenCV for ARM Cortex-A8
- Linux下移植OpenCV + Qt 到ARM(Tiny6410)总结
QImage Mat2QImage(cv::Mat const& src)
{
cv::Mat temp; // make the same cv::Mat
cvtColor(src, temp,CV_BGR2RGB); // cvtColor Makes a copt, that what i need
QImage dest((const uchar *) temp.data, temp.cols, temp.rows, temp.step, QImage::Format_RGB888);
dest.bits(); // enforce deep copy, see documentation
// of QImage::QImage ( const uchar * data, int width, int height, Format format )
return dest;
}
cv::Mat QImage2Mat(QImage const& src)
{
cv::Mat tmp(src.height(),src.width(),CV_8UC3,(uchar*)src.bits(),src.bytesPerLine());
cv::Mat result; // deep copy just in case (my lack of knowledge with open cv)
cvtColor(tmp, result,CV_BGR2RGB);
return result;
}
- cv::Mat to QImage and back
- opencv cv::MAT 和 QT QImage 相互转化代码
- QImage 与 cv::Mat 之间的相互转换
- IplImage QImage Mat 格式互转
- 人脸识别系统开发(7) -- cv::Mat与QImage相互转换
- How to convert QImage to opencv Mat
QString str;
str.sprintf("%s %d", "string", 213);