QImage和IplImage的转换(简单方法)

    IplImage *img = cvLoadImage("girl.jpg",1);
    cvConvertImage(img,img,CV_CVTIMG_SWAP_RB);
    const unsigned char *pImg = (unsigned char *)img->imageData;
    frame = new QImage(pImg, img->width, img->height,img->widthStep, QImage::Format_RGB888);

你可能感兴趣的:(QImage和IplImage的转换(简单方法))