opencv Mat 多通道的使用

代码是8通道Mat的使用方法。

typedef cv::Vec<float, 8> Vec8f;
    E2 = cv::Mat::zeros(srcImage.rows, srcImage.cols, CV_32FC(8));//背景 E(0)值
    //CV_32FC3
    std::cout << "channel = " << E2.channels() << " \n ";
    for (int i = 0; i < E2.rows; i++)
    {
        for (int j = 0; j < E2.cols; j++)
        {
            for (int c = 0; c < E2.channels(); c++)
            {
                std::cout << "channel = " << c << "  ";
                std::cout << E2.at<Vec8f>(i, j)[c] << " ;i = " << i << " j= " << j << " c= " << c << "\n";
            }
        }
    }

 

https://www.cnblogs.com/cvtoEyes/p/8494516.html

posted @ 2020-05-21 11:52  爱学英语的程序媛  阅读(641)  评论(0编辑  收藏  举报