Subversion Repositories seema-scanner

Rev

Rev 207 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 207 Rev 245
Line 38... Line 38...
38
        cv::Mat rgb(mat.size(), CV_32FC3);
38
        cv::Mat rgb(mat.size(), CV_32FC3);
39
        cv::cvtColor(mat, rgb, cv::COLOR_GRAY2RGB);
39
        cv::cvtColor(mat, rgb, cv::COLOR_GRAY2RGB);
40
        QImage img((const uchar*)rgb.data, rgb.cols, rgb.rows, rgb.step, QImage::Format_RGB32);
40
        QImage img((const uchar*)rgb.data, rgb.cols, rgb.rows, rgb.step, QImage::Format_RGB32);
41
        img = img.copy();
41
        img = img.copy();
42
        return img;
42
        return img;
-
 
43
    } else if(mat.type()==CV_32FC3) {
-
 
44
        QImage img((const uchar*)mat.data, mat.cols, mat.rows, mat.step, QImage::Format_RGB32);
-
 
45
        img = img.copy();
-
 
46
        return img;
43
    } else {
47
    } else {
44
        std::cerr << "SMVideoWidget: cv::Mat could not be converted to QImage!";
48
        std::cerr << "SMVideoWidget: cv::Mat could not be converted to QImage!";
45
        return QImage();
49
        return QImage();
46
    }
50
    }
47
 
51