角点检测算法
发布日期:2021-05-14 12:52:41 浏览次数:28 分类:精选文章

本文共 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������������������
vector
corners;
// ������Shi-Tomasi������������
goodFeaturesToTrack(image, corners, 200, 0.01, 10);
// ���������������������������
drawKeypoints(image, corners, image, Scalar(255,255,255), DRAW_RICH_KEYPOINTS);
}

FAST������

void fastDetect() {
// ������������������
vector
keypoints;
// ���������FAST���������
FastFeatureDetector fast(40, true);
// Detect������
fast.detect(image, keypoints);
// ���������������������
drawKeypoints(image, keypoints, image, Scalar::all(255), DRAW_OVER_OUTIMG);
}

SIFT������

void siftDetect() {
// SIFT������������
vector
keypoints;
SiftFeatureDetector sift(0.03, 10);
sift.detect(image, keypoints);
// ���������������������
drawKeypoints(image, keypoints, image, Scalar(255,255,255), DRAW_RICH_KEYPOINTS);
}

SURF������

void surfDetect() {
// SURF������������
vector
keypoints1, 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���������������������������������������������������������������������������������������������������������

上一篇:反向传播
下一篇:DBSCAN原理

发表评论

最新留言

很好
[***.229.124.182]2025年04月25日 15时40分44秒