I have written the snippet code below to save multiple images with different names but it doesn't work. Thanks in advance for your help.
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
#include <sstream>
........
int nBlur[] = {5, 7, 13};
BOOST_FOREACH( int i, nBlur)
{
std::string str = boost::lexical_cast<std::string>(i); // convert i to string
string imgF = "imgBlur" + i;
const char *imgFile = imgF.c_str();
GaussianBlur(imgGray, imgGrayBlur, Size(i,i), 0, 0 );
//imshow("Blurring image", imgGrayBlur);
Mat blurred(imgGrayBlur);
imwrite(imgFile+".png", imgGrayBlur);
}