Ask Your Question

Revision history [back]

Your Mat is of type CV_8U, so you should access it's elements using:

image.at<uchar>(y,x)=0

However, you can also create a matrix of all zeros using :

Mat Z = Mat::zeros(3,3, CV_8UC1);