Ask Your Question

Revision history [back]

My first reaction would be to ask why you would use the old C-style interface? If there is no specific reason, then please use the C++ interface, using Mat objects, which has a way larger support for the moment.

As to your problem, use the following commands

IplImage* img;
cvSet(img, cvScalar(0,0,0));

My first reaction would be to ask why you would use the old C-style interface? If there is no specific reason, then please use the C++ interface, using Mat objects, which has a way larger support for the moment.

As to your problem, use the following commands

IplImage* img;
cvSet(img, cvScalar(0,0,0));

Which could be used for setting every possible value. However it can be done even more easily:

IplImage* img;
cvZero(img, cvScalar(0,0,0));

My first reaction would be to ask why you would use the old C-style interface? If there is no specific reason, then please use the C++ interface, using Mat objects, which has a way larger support for the moment.

As to your problem, use the following commands

IplImage* img;
cvSet(img, cvScalar(0,0,0));

Which could be used for setting every possible value. However it can be done even more easily:

IplImage* img;
cvZero(img, cvScalar(0,0,0));
cvZero(img);