Exemplo n.º 1
0
void findSkyFromCannyImage(const Mat& cannyimg,vector<Point> (&edges)[2])
{
	int width=cannyimg.cols-1;
	int height=cannyimg.rows;

	int currenty=2;
	int currentx;
	findStartX(cannyimg,currentx,currenty);

//	auto sth=static_cast<int> (cannyimg.at<uchar>(Point(0,0)));

	while (( grayValue(cannyimg,currentx,currenty) ==0 )&&(currenty<height))
	{
		int leftx(currentx),rightx(currentx);
		while((leftx>1)&&(grayValue(cannyimg,--leftx,currenty)==0))
			;
		while((rightx<width)&&(grayValue(cannyimg,++rightx,currenty)==0))
			;		
		
		edges[0].push_back(Point(leftx,currenty));
		edges[1].push_back(Point(rightx,currenty));
		
		currentx=(leftx+rightx)/2;

		++currenty;

	}
	
}
Exemplo n.º 2
0
void Crosspointer::doStage2Cross() {
	if(findXtoFirstSR()) findXonSpecRows();
	findStartX();
}