Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How can I initialize Mat with integer value?

I tried to initialize Mat with some int values, but it yielded error. How can I initialize Mat with some integer values? Here is my code:

int main(...)
{
Mat image(3, 3, CV_8U);

for(int y=0;y<3;y++)
{
  for(int x=0;x<3;x++)
  {
    image.at<int>(y,x)=0;//error here

  }
}
}