2012-11-03 32 views
4

我一直在阅读有关特征探测并希望尝试哈里斯角落探测器。我知道这是通过调用改善哈里斯角落探测器的结果

void cornerHarris(InputArray src, OutputArray dst, int blockSize, int ksize, double k, int borderType=BORDER_DEFAULT)

其中dst为含角强度在每个像素浮子的图像来实现。

我想看看它的工作,所以我想将它应用到如下图:

pic of a laptop http://i49.tinypic.com/dbijh3.jpg

产生的结果是这样的:

corners not detected http://i49.tinypic.com/jgtzqt.jpg

正如您所知道的结果不好。在我看来,它只是拾起噪音,主要角落甚至没有被发现。

这里是我用来打印图像上的角落的代码,我使用了阈值并为阈值设置了任意值。

int _tmain(int argc, _TCHAR* argv[]) 
{ 

Mat img, dst, threshed; 
img = imread("c:\\laptop.jpg",0); 

dst = Mat::zeros(img.size(), CV_32FC1); 

cornerHarris(img, dst, 2, 3, 0.04, BORDER_DEFAULT); 



threshold(dst, threshed, 0.00001, 255, THRESH_BINARY_INV); 

namedWindow("meh", CV_WINDOW_AUTOSIZE); 
imshow("meh", threshed); 
//imwrite("harris.jpg", threshed); 
waitKey(0); 

return 0; 

If I reduce threshold the result is white with just a few black dots (detections) Increasing threshold just produces a more noisy like image.

我缺少的东西?我该如何提高此功能的质量?

谢谢

回答

8

你可以尝试goodFeaturesToTrack功能。它建立在哈里斯角落探测器的顶部,但过滤了我们的噪音并仅返回了强烈的角落。

+1

谢谢你,这不是靠近corener检测文档的任何地方,你怎么(或一个学习)甚至来到这里? – StuckInPhD