I am trying to save a sequence of images in visual studio 2008,all with the prefix of "Image". the only differentiating factor should be their number. for example if I am gonna save 10 images then the situation should be
i=1;
while(i<10)
{
cvSaveImage("G:/OpenCV/Results/Imagei.jpg",img2);
i++
//"i" is gonna be different every time
}
so I need to concatenete the integer with the string... looking forward to the answer...
The c++ way (pre-c++11) would be:
#include <sstream>
...
ostringstream convert;
convert << "G:/OpenCV/Results/Image" << i << ".jpg";
cvSaveImage(convert.str().c_str(), img2);
i++;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With