源码
#include <opencv2/opencv.hpp>
#include <opencv2/highgui/highgui_c.h>
#include <iostream>
using namespace cv;
using namespace std;
char filename[] = {
0 };
int main(int argc, char** argv)
{
Mat src, dest, gray, binary;
cout << "----------------------------------------------------------------" << endl << endl;
cout << "Please enter a image path as follows and press Enter." << endl << endl;
cout << "Eg: F:/cvpicture/flower.png" << endl << endl;
cout << "ps: Image preview will automatically turn off after 30 seconds!" << endl << endl