Stu*_*PhD 4 opencv feature-detection
我一直在阅读有关特征检测的内容,并想尝试哈里斯角点检测器.我意识到这是通过打电话来实现的
void cornerHarris(InputArray src, OutputArray dst, int blockSize, int ksize, double k, int borderType=BORDER_DEFAULT )
其中dst是每个像素包含角度强度的浮点图像.
我想看到它的工作,所以我想把它应用到下面的图片:
笔记本电脑的照片http://i49.tinypic.com/dbijh3.jpg
结果是:
未检测到角落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;
Run Code Online (Sandbox Code Playgroud)
If I reduce threshold the result is white with just a few black dots (detections) Increasing threshold just produces a more noisy like image.
我错过了什么吗?如何提高此功能的质量?
谢谢
归档时间: |
|
查看次数: |
7031 次 |
最近记录: |