如何用opencv中从另一个矩阵中提取的值填充矩阵

时间:2016-04-19 13:13:39

标签: c++ opencv matrix

我想用opencv中的矩阵填充已经填充的其他矩阵的值

这是第一个矩阵:

Mat vv = Mat::zeros(800,600, CV_8UC3); //CV_8UC3 is for 3-channel value

for(int jz = 0; jz < 800; jz++)
{ 
  for (int jy = 0; jy < 600; jy++)
  {
    vv.at<cv::Vec3d>(jz,jy,1) = maxy + jy *stepy;
    vv.at<cv::Vec3d>(jz,jy,2) = maxz + (801 - jz) *stepz;

  }

}

我想用vv的元素填充矩阵w,如下所示:

for j1 = 1:800
       for j2 = 1:600
            w = [-k; vv(j1,j2,1);vv(j1,j2,2)];
            w = w / norm(w);

感谢您的回复

0 个答案:

没有答案