利用Emgucv提取surf特征点,如何获取特征点的像素坐标(x、y)?

WGS0806 2016-12-04 02:56:21
如题,楼主想得到surf提取的特征点坐标,代码如下:
public void FindMatch(Image<Gray, Byte> modelImage, Image<Gray,byte> observedImage, out long matchTime, out VectorOfKeyPointmodelKeyPoints, out VectorOfKeyPoint observedKeyPoints, out Matrix<int>indices, out Matrix<byte> mask, out HomographyMatrix homography)
{
int k = 2;
double uniquenessThreshold = 0.8;
SURFDetector surfCPU = newSURFDetector(500, false);
Stopwatch watch;
homography = null;

//extract features from the objectimage
modelKeyPoints = newVectorOfKeyPoint();
Matrix<float>modelDescriptors = surfCPU.DetectAndCompute(modelImage, null, modelKeyPoints);
watch = Stopwatch.StartNew();
// extract features from theobserved image
observedKeyPoints = newVectorOfKeyPoint();
Matrix<float>observedDescriptors = surfCPU.DetectAndCompute(observedImage, null,observedKeyPoints);
BruteForceMatcher<float>matcher = new BruteForceMatcher<float>(DistanceType.L2);
matcher.Add(modelDescriptors);
indices = newMatrix<int>(observedDescriptors.Rows, k);
using (Matrix<float> dist =new Matrix<float>(observedDescriptors.Rows, k))
{
matcher.KnnMatch(observedDescriptors, indices, dist, k, null);
mask = newMatrix<byte>(dist.Rows, 1);
mask.SetValue(255);
Features2DToolbox.VoteForUniqueness(dist, uniquenessThreshold, mask);
}
int nonZeroCount =CvInvoke.cvCountNonZero(mask);
if (nonZeroCount >= 4)
{
nonZeroCount =Features2DToolbox.VoteForSizeAndOrientation(modelKeyPoints, observedKeyPoints,indices, mask, 1.5, 20);
if (nonZeroCount >= 4)
homography =Features2DToolbox.GetHomographyMatrixFromMatchedFeatures(modelKeyPoints,observedKeyPoints, indices, mask, 2);
}
watch.Stop();
matchTime = watch.ElapsedMilliseconds;
}

求大神来解答啊!
...全文
786 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
你好,请问一下,匹配点的属性信息和匹配之前该特征点的属性信息是不是一样,比如尺度因子
qq_30049951 2017-09-14
  • 打赏
  • 举报
回复
你好,我现在用emgucv显示图像,想获取鼠标点击位置的image的像素点坐标(相对于图片的),请问一下该怎么做,谢谢
WGS0806 2016-12-04
  • 打赏
  • 举报
回复
已解决。。。
WGS0806 2016-12-04
  • 打赏
  • 举报
回复
有没有人来看看啊
WGS0806 2016-12-04
  • 打赏
  • 举报
回复
得到的newVectorOfKeyPoint()类型的对象里并没有存各特征点的坐标信息,那坐标应该怎么看呢?

65,210

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

试试用AI创作助手写篇文章吧