#include "opencv2/core.hpp"
#include "opencv2/imgproc.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/videoio.hpp"
#include <iostream>
#include<stdio.h>
#include<fstream>
using namespace cv;
using namespace std;
string DoubleToString(double Input)
{
stringstream Oss;
Oss << Input;
return Oss.str();
}
string path = "C:\\Users\\Sunym\\Desktop\\hongzh.jpg";
string outToPath = "C:\\Users\\Sunym\\Desktop\\原图.txt";
void showGreyOriSmallPic() {
cout << "Built with OpenCV " << CV_VERSION << endl;
Mat image = imread("C:\\Users\\Sunym\\Desktop\\hongzh.jpg");//见注1
imshow("原始图像", image);//见注2
resize(image, image, Size(360, 202));//见注3
imwrite("D:\\xinyuan.jpg", image);//见注4
imshow("缩小图像", image);
cvtColor(image, image, CV_RGB2GRAY);//见注5
imshow("灰度图像", image);
waitKey(0);//见注6
}
void getCamera() {
VideoCapture cap(0); //capture the video from web cam
if (!cap.isOpened()) // if not success, exit program
{
cout << "Cannot open the web cam" << endl;
return ;
}
namedWindow("Control", CV_WINDOW_AUTOSIZE); //create a window called "Control"
int iLowH = 100;
int iHighH = 140;
int iLowS = 90;
int iHighS = 255;
int iLowV = 90;
int iHighV = 255;
//Create trackbars in "Control" window
cvCreateTrackbar("LowH", "Control", &iLowH, 179); //Hue (0 - 179)
cvCreateTrackbar("HighH", "Control", &iHighH, 179);
cvCreateTrackbar("LowS", "Control", &iLowS, 255); //Saturation (0 - 255)
cvCreateTrackbar("HighS", "Control", &iHighS, 255);
cvCreateTrackbar("LowV", "Control", &iLowV, 255); //Value (0 - 255)
cvCreateTrackbar("HighV&#