//寻找曲线 :
void findLines(Mat &binaryImg, vector> &outLines)
{
//八邻域
vector neighborPtVec;
neighborPtVec.push_back(Point(-1,-1));
neighborPtVec.push_back(Point(0,-1));
neighborPtVec.push_back(Point(1,-1));
neighborPtVec.push_back(Point(1,0));
neighborPtVec.push_back(Point(1,1));
neighborPtVec.push_back(Point(0,1));
neighborPtVec.push_back(Point(-1,1));
neighborPtVec.push_back(Point(-1,0));
Point firstPt;
while (findFirstPoint(binaryImg, firstPt))
{
deque line;//点的队列
line.push_back(firstPt);//存储第一个点
//由于第一个点不一定是线段的起始位置,
//因此两个方向都要查找
Point currPt = firstPt;//当前点
int currFlag = 0;//标志
Point nextPt;//下一个点
int nextFlag;//下一点的标志
while (findNextPoint(neighborPtVec, binaryImg, currPt, currFlag, nextPt