Here is the code implemented in C ++ opencv save the image:
opencv version 3.0
#include <opencv2/core/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <iostream>
int main ()
{
// read the image source
cv::Mat srcImage = cv::imread("lena.jpg");
if( srcImage.empty() )
return -1;
// writing image files
cv::imwrite("dst_Image.png", srcImage);
return 0;
}