SyntaxFix
Write A Post
Hire A Developer
Questions
You can choose filling zero data or create zero Mat.
Filling zero data with setTo():
img.setTo(Scalar::all(0));
Create zero data with zeros():
img = zeros(img.size(), img.type());
The img changes address of memory.