Subversion Repositories seema-scanner

Rev

Rev 2 | Rev 23 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2 Rev 21
Line 18... Line 18...
18
        return img;
18
        return img;
19
    } else if(mat.type()==CV_8UC3) {
19
    } else if(mat.type()==CV_8UC3) {
20
        // Copy input Mat
20
        // Copy input Mat
21
        QImage img((const uchar*)mat.data, mat.cols, mat.rows, mat.step, QImage::Format_RGB888);
21
        QImage img((const uchar*)mat.data, mat.cols, mat.rows, mat.step, QImage::Format_RGB888);
22
        return img.rgbSwapped();
22
        return img.rgbSwapped();
-
 
23
    } else if(mat.type()==CV_16UC1) {
-
 
24
        mat.convertTo(mat, CV_8UC1, 1.0/256.0);
-
 
25
        return cvMat2qImage(mat);
23
    } else if(mat.type()==CV_32FC1) {
26
    } else if(mat.type()==CV_32FC1) {
24
        cv::Mat rgb(mat.size(), CV_32FC3);
27
        cv::Mat rgb(mat.size(), CV_32FC3);
25
        rgb.addref();
28
        rgb.addref();
26
        cv::cvtColor(mat, rgb, cv::COLOR_GRAY2RGB);
29
        cv::cvtColor(mat, rgb, cv::COLOR_GRAY2RGB);
27
        // Copy input Mat
30
        // Copy input Mat