简体   繁体   English

Opencv 3.0快速角检测

[英]Opencv 3.0 FAST Corner Detection

I am beginner in OpenCV. 我是OpenCV的初学者。 I have problem implement FAST algoritmus in Vsual Studio with version OpenCV 3.0 . 我在OpenCV 3.0版本的Vsual Studio中实现FAST算法有问题。 I have tried following implementation in c++ : 我尝试了以下在c ++中的实现:

src = imread("../images/right.jpg", CV_LOAD_IMAGE_GRAYSCALE);
Ptr<FastFeatureDetector> detector = FastFeatureDetector::create(TRESHOLD);
vector<KeyPoint> keypointsD;

with (but both realizations are BAD ) 与(但两个实现都是BAD

detector->detect(src, keypointsD);
drawKeypoints(src, keypointsD, output);
imshow(window_name, output);

or 要么

FAST(src, keypointsD, TRESHOLD, true); //fast detector
drawKeypoints(src, keypointsD, output);
imshow(window_name, output);

Can you help me with any example or what Do I do bad? 您能帮我举任何例子还是我做错什么?

Are you sure, that you have to make an detector? 您确定必须制造一个探测器吗? I have the following Example which is compiling: 我有以下示例正在编译:

Mat src; Mat tmp; Mat dst;
vector<KeyPoint> keypoints;

src = imread(imageName, -1);
FAST(src,keypoints,0,false);

if(keypoints.size() > 0){
cout << keypoints.size() << endl;

Sure it is just a snippet of my code, actually I take a Image and downscale it with a factor with a do while loop until keypoints.size <= 0. But It has everything that you need I think. 当然,这只是我的代码的一部分,实际上,我拍摄了一个Image并使用do while循环将其按比例缩小,直到keypoints.size <=0。但是,它具有我认为需要的一切。 When I compile my code it gives me the Numbers of Keypoints it found. 当我编译代码时,它会为我提供找到的关键点数量。

Example: 例:

83742
42064
23470
13255
7290
3877
1947
915
404
151
74
24

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM