如何在opencv中显示多维矩阵

时间:2016-05-02 14:25:10

标签: c++ arrays opencv matrix

我想在opencv中显示一个多维矩阵B(1000,1000,3),以便在每个(i,j,k)索引处查看此矩阵的值 这是我的声明以及我如何填写这个矩阵

 Mat   image1 = imread("C://images//PolarImage300915163358.bmp"); // image 800*600
    int dim1[3] = {1000,1000,3};
    Mat B(3,dim1, CV_64F, Scalar::all(-1)); 
    for (int j1 = 0; j1 < 800; j1++)
      {
       for (int j2 = 0; j2 < 600; j2++)
        {
         jj1 =  round( ((double)phi/stepphi)+701.0);
         jj2 =  round( ((double)theta/steptetha)+501.0);

         B.at<double>(1199-jj1,jj2,0) =  image1.at<double>(j1,j2);
         B.at<double>(1199-jj1,jj2,1) =  image1.at<double>(j1,j2);
         B.at<double>(1199-jj1,jj2,2) =  image1.at<double>(j1,j2); 
      }
    }

0 个答案:

没有答案