I am trying to create a Mat with the same size and type of another. All elements of the new Mat should be zero, so I tried the function Mat::zeros(size, type) , defined as:
static MatExpr zeros(Size size, int type);
This is my code. Suppose I already have Mat g (created using imread ):
Mat h = Mat::zeros(g.size, g.type());
This will give me a compiler error complaining that:
There is no corresponding function to call "zeros"
What am I doing wrong?
source share