2012-11-03 30 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