Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

for a grayscale image this should work (works for me, I use openCV 3.0): Mat zeroMat = Mat::zeros(n_rows, n_cols, CV_8UC1); where n_rows and n_cols are the number of rows and colums (thus, int) respectively. if your image is not grayscale, change the last entry.

click to hide/show revision 2
No.2 Revision

updated 2016-10-11 02:19:27 -0600

berak gravatar image

for a grayscale image this this should work (works for me, I use openCV 3.0): 3.0):

 Mat zeroMat = Mat::zeros(n_rows, Mat.zeros(n_rows, n_cols, CV_8UC1);
CvType.CV_8UC1);

where n_rows and n_cols are the number of rows and colums (thus, int) respectively. if your image is not grayscale, change the last entry.