Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version
/// oOut.type == CV_32S;
for (int i = 0; i < oOut.rows; i++)
{
  // the mat might not be continuous, so restart for each row
  int * row = oOut.ptr<int>(i); 
  for (int j = 0; j < oOut.cols; j++)
  {    
    row[j] = 123456;
  }
}

  // if oOut.type == CV_32F, it might look like this:
  // float * row = oOut.ptr<float>(i);

.. you 'll get the picture ..

/// oOut.type == CV_32S;
CV_32F;
for (int i = 0; i < oOut.rows; i++)
{
  // the mat might not be continuous, so restart for each row
  int float * row = oOut.ptr<int>(i); oOut.ptr<float>(i);    
  for (int j = 0; j < oOut.cols; j++)
  {    
    row[j] = 123456;
  }
}

  // if oOut.type == CV_32F, CV_32S, it might look like this:
  // float int * row = oOut.ptr<float>(i);
oOut.ptr<int>(i);

.. you 'll get the picture ..