This worked for me: QImage MatToQImage(const Mat& mat) { // 8-bits unsigned, NO. OF CHANNELS=1 ...
stackoverflow.com