#include "mainwindow.h"
QPixmap MainWindow::MtoP(cv::Mat amat){
cv::Mat mat;
cvtColor(amat, mat,CV_BGR2RGB);//これがなかったら色が青になっちゃったよ
return QPixmap::fromImage(QImage((unsigned char*) mat.data, mat.cols, mat.rows, static_cast<int>(mat.step), QImage::Format_RGB888));
}
参考URL::http://stackoverflow.com/questions/17127762/cvmat-to-qimage-and-back