opencv Mat QImage

opencv Mat  QImage

 

    if (imgParam.channels() == 3)
    {
        cv::cvtColor(imgParam, rgb, CV_BGR2RGB);
        img = QImage((const uchar*)(rgb.data), rgb.cols, rgb.rows, rgb.cols*rgb.channels(), QImage::Format_RGB888);
    }
    else
    {
        img = QImage((const uchar*)(imgParam.data), imgParam.cols, imgParam.rows, imgParam.cols*imgParam.channels(), QImage::Format_Indexed8);
    }

 

 

 

 

#############################

上一篇:用C语言实现最小路径和


下一篇:MySQL-5.7-Multi-Range Read Optimization