robust corner detection

Hey guys

I am trying to find a good way to implement a good corner detection function.

below is my code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
cvtColor(image,grayscale,CV_BGR2GRAY);
		//goodfeatures(grayimage, output to store corners, quality factor, distance factor)
		goodFeaturesToTrack(grayscale,corners,4,0.1,155);   //good so far 0.1 and 150, 150 0.01 
		// Mark these corners on the original image
		cornerSubPix(grayscale, corners, Size(11, 11), Size(-1, -1), TermCriteria(CV_TERMCRIT_EPS | CV_TERMCRIT_ITER, 30, 0.1));
		if(corners.rows!=0)
		{
			for(int i=0;i<corners.rows;i++)
			{
				//draws circle on image, at centre at point, color, thickness, line type, 
				circle(image,corners.at<Point2f>(i),3,CV_RGB(255,0,0),1,8,0);
			}
		}
		else
		{
			cout<<"No Corners Detected"<<endl;
		}


and this is executed for each frame from the webcam, the problem is that the corners sometimes move a little

below is an example, the corners they like to jump back and forth.
they don't stay still, is there a way to keep it stuck on its position, so when the paper is rotated it is fixed on that corner detected.

http://i43.tinypic.com/30ic120.jpg

thanks
Topic archived. No new replies allowed.