Fast corner detection

来源:互联网 发布:笔记本什么牌子好 知乎 编辑:程序博客网 时间:2024/05/05 00:07
int _tmain(int argc, _TCHAR* argv[]) {Mat img = imread("LenaGr.jpg", 0);//vector of KeyPointsvector<KeyPoint> keyPoints;//construction of the fast feature detector objectFastFeatureDetector fast(40);//feature point detectionfast.detect(img, keyPoints);drawKeypoints(img, keyPoints, img, Scalar::all(-1), DrawMatchesFlags::DEFAULT);//output all the (x,y) of keypointvector<KeyPoint>::iterator it;for(it = keyPoints.begin(); it != keyPoints.end(); ++it) {printf("x=%f y=%f\n", it->pt.x, it->pt.y);}namedWindow("img", WINDOW_AUTOSIZE);imshow("img", img);waitKey(0);return 0;}