
本文共 4618 字,大约阅读时间需要 15 分钟。
������������������������
������������
���������������������������������������������������������������������������������������������������������������������������Harris���������������Shi-Tomasi���������FAST���������������SIFT������������������SURF������������������������������������������������������������������������������������������������������������������������������������������
������������
Harris������������
Harris���������������������������������������������������������������������������������������������������������������������Hessian������������������������������������������������������Hessian������������������������������������������������������������������������������������������������������������
Shi-Tomasi������������
Shi-Tomasi���������Harris������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
FAST������������
FAST���Features At SCALA������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
SIFT������������
SIFT���Scale Invariant Feature Transform���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������
SURF������������
SURF���Speeded Up Robust Features������������SIFT������������������������������������������Hessian���������������������������������������������������������������������������������������������������������������
������������
Harris������������
void detect(const Mat &image) { // ������������������������������������������������ int block_size = 3; if (image.size().height < 2*block_size-1 || image.size().width < 2*block_size-1) { return; } Mat harris = createHarrisMatrix(image, 120); Mat localMax = Mat::zeros(image.size(), CV_8UC1); compare(harris, localMax, localMax, CMP_EQ); // ������������������ threshold(harris, localMax, 255, THRESH���ng237IN}
Shi-Tomasi������
void goodFeaturesDetect() { // ���������Harris������������������ vectorcorners; // ������Shi-Tomasi������������ goodFeaturesToTrack(image, corners, 200, 0.01, 10); // ��������������������������� drawKeypoints(image, corners, image, Scalar(255,255,255), DRAW_RICH_KEYPOINTS);}
FAST������
void fastDetect() { // ������������������ vectorkeypoints; // ���������FAST��������� FastFeatureDetector fast(40, true); // Detect������ fast.detect(image, keypoints); // ��������������������� drawKeypoints(image, keypoints, image, Scalar::all(255), DRAW_OVER_OUTIMG);}
SIFT������
void siftDetect() { // SIFT������������ vectorkeypoints; SiftFeatureDetector sift(0.03, 10); sift.detect(image, keypoints); // ��������������������� drawKeypoints(image, keypoints, image, Scalar(255,255,255), DRAW_RICH_KEYPOINTS);}
SURF������
void surfDetect() { // SURF������������ vectorkeypoints1, keypoints2; Mat descriptors1, descriptors2; // ������������ SurfFeatureDetector surf(2500); // Detect������ surf.detect(image, keypoints1); surf.detect(image2, keypoints2); // ��������������������� SurfDescriptorExtractor extractor; extractor.compute(image, keypoints1, descriptors1); extractor.compute(image2, keypoints2, descriptors2); // XXX��������������� BruteForceMatcher L2 matcher; vector matches; matcher.match(descriptors1, descriptors2, matches); // XXX������������������ nth_element(matches.begin(), matches.begin() + 24, matches.end()); matches.erase(matches.begin() + 25, matches.end()); // ��������������������������� Mat img_matches; drawMatches(image, keypoints1, image2, keypoints2, matches, img_matches, Scalar(255,255,255)); drawKeypoints(image, keypoints1, image, Scalar(255,255,255), DRAW_RICH_KEYPOINTS);}
������������
���������������������Harris������������������������������������������������������������Shi-Tomasi���������������������������������������������������������FAST���������������������������������������������������������������������������������������SIFT���SURF���������������������������������������������������������������������������������������������������������
发表评论
最新留言
关于作者
