I copied the raw image data from QImage (Qt Framework) to Mat with the code below:
Mat img(qimage.height(), qimage.width(), CV_8UC1, reinterpret_cast<void*>(qimage.bits()), qimage.bytesPerLine())
Due to byte alignment, qimage.width() may not be equal to qimage.bytesPerLine(). If they are equal, the wechat_qrcode works correctly; otherwise, it fails.
I copied the raw image data from QImage (Qt Framework) to Mat with the code below:
Mat img(qimage.height(), qimage.width(), CV_8UC1, reinterpret_cast<void*>(qimage.bits()), qimage.bytesPerLine())Due to byte alignment,
qimage.width()may not be equal toqimage.bytesPerLine(). If they are equal, the wechat_qrcode works correctly; otherwise, it fails.