包含: C:\local\boost_1_55_0\
库目录: C:\local\boost_1_55_0\lib32-msvc-10.0
#pragma comment(lib,"ws2_32.lib")
#include <cstdio>
#include <Winsock2.h>
//add by xia 510 for send socket end
#include <iostream>
#include <opencv2\opencv.hpp>
#include <string>
#include <vector>
#include "eye_tracker.h"
//#include <fstream>
#include <boost/tokenizer.hpp>
#include <boost/filesystem/convenience.hpp>
#include <boost/program_options.hpp>
using namespace cv;
using namespace std;
using namespace boost;
//-----------------------------------------------------------------------
int centerx = 450;
int centery = 465;
int rect_w = 200;int rect_h = 64;
//读取一行并解析
string stringLine;//一行字符串
ifstream infile;
vector<string> tempLine;//空格隔开的数组
infile.open ("C:\\auto\\Eyetrace_centerview\\rect.txt");
//读取一行
getline(infile,stringLine);
char_separator<char> sep(",");
tokenizer<char_separator<char>> tok(stringLine, sep);
for(tokenizer<char_separator<char>>::iterator beg=tok.begin(); beg!=tok.end(); ++beg)
{
tempLine.push_back( *beg );
}
centerx = atoi(tempLine[0].c_str());
centery = atoi(tempLine[1].c_str());
rect_w = atoi(tempLine[2].c_str());
rect_h = atoi(tempLine[3].c_str());
tempLine.clear();
infile.close();
//写入一行
ofstream fout( "C:\\auto\\Eyetrace_centerview\\rect.txt");
fout << centerx << ","<< centery << ","<< rect_w << ","<< rect_h<< endl;
fout.close();