kinect图像提取问题,跪求解答。
kinect吧
全部回复
仅看楼主
level 4
我需要提取每一帧的图像,然后需要对图像相邻两帧进行两两匹配,用的opencv。求大神解答怎么提取临近两帧的图像呢?
2014年08月13日 06点08分 1
level 4
但是我想进行特征点提取并匹配,不知道怎么写那个代码,你们看这是我写的仅仅是提取两幅图并提取特征点并匹配的代码,这是可以用的。但是就是不知道怎么和kinect结合。
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/nonfree/features2d.hpp>
#include<opencv2/legacy/legacy.hpp>
using namespace cv;
using namespace std;
int main (){
Mat image1;
Mat image2;
Mat featureImage1;
Mat featureImage2;
image1= imread("church01.jpg");
image2= imread("church02.jpg");
vector<KeyPoint>keypoints1;
vector<KeyPoint>keypoints2;
SurfFeatureDetector surf(2500);
surf.detect(image1,keypoints1);
surf.detect(image2,keypoints2);
drawKeypoints(image1,keypoints1,featureImage1,Scalar(255,255,255),DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
drawKeypoints(image2,keypoints2,featureImage2,Scalar(255,255,255),DrawMatchesFlags::DRAW_RICH_KEYPOINTS);
SurfDescriptorExtractor surfDesc;
Mat descriptors1;
surfDesc.compute(image1,keypoints1,descriptors1);
Mat descriptors2;
surfDesc.compute(image2,keypoints2,descriptors2);
BruteForceMatcher<L2<float>>matcher;
vector<DMatch>matches;
matcher.match(descriptors1,descriptors2,matches);
nth_element(matches.begin(),matches.begin()+24,matches.end());
matches.erase(matches.begin()+25,matches.end());
Mat imageMatches;
drawMatches(image1,keypoints1,image2,keypoints2,matches,imageMatches,Scalar(255,255,255));
namedWindow("surf Features1");
imshow("surf Features1",featureImage1);
namedWindow("surf Features2");
imshow("surf Features2",featureImage2);
namedWindow("匹配结果");
imshow("匹配结果",imageMatches);
waitKey(0);
}
2014年08月13日 06点08分 3
level 4
跪求大神讲解如何提取相邻两帧图像,,,这样就可以匹配了。
2014年08月13日 06点08分 4
level 1
hxd
解决了吗?我最近也在搞这个
2023年03月14日 09点03分 5
1