1、imread 读入图像,最后一个参数0表示按灰度读入
2、imwrite 保存成新的图像
#include <iostream>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/core/core.hpp>
#include <opencv2/opencv.hpp>
using namespace std;
using namespace cv;
int main(int argc, char *argv[])
{
cout<<argc<<endl;
cout<<argv[0]<<endl;
Mat image = imread("pathPlanningPlatform.png", 0);
namedWindow("picture1", CV_WINDOW_AUTOSIZE);
cout<<"Image In Rows : "<<image.rows<<endl;
cout<<"Image In Columns : "<<image.cols<<endl;
imshow("picture1", image);
waitKey(0);
imwrite("pathPlanningPlatformOut.png",image);
return 0;
}