Mat::Zeros doesn't seem to do anything when called from object (Bug #320)
Description
example:
Mat x = Mat(100, 100, CV_8UC1);
x.zeros(x.size(), x.type());
This doesn't do anything to the image.
But this does work:
x = Mat::zeros(x.size(), x.type());
Now I use:
x.setTo(Scalar(0));
to reset an image which is okay, but somehow I think it would be much easier to be able to just use x.zeros() (without arguments).
History
Updated by Gijs Molenaar almost 15 years ago
I mean more intuitive, not easier
Updated by Vadim Pisarevsky over 14 years ago
you can simply write
x = Scalar(0);
this is not a bug, this is how C++ works. zeros() is a static method that is, for some strange reasons, is still allowed to be called as <Mat instance>.zeros(), not as Mat::zeros().
- Status changed from Open to Done
- (deleted custom field) set to wontfix