IplImage *frame;
QImage image = QImage((const uchar*)frame->imageData, frame->width, frame->height, QImage::Format_RGB888).rgbSwapped();
IplImage到QImage转换
本文介绍了一种从OpenCV的IplImage格式转换到Qt的QImage格式的方法。通过使用rgbSwapped()函数确保图像的颜色通道正确转换,使得在Qt应用程序中能够正确显示从OpenCV获取的图像。
IplImage *frame;
QImage image = QImage((const uchar*)frame->imageData, frame->width, frame->height, QImage::Format_RGB888).rgbSwapped();

被折叠的 条评论
为什么被折叠?