Matlab SURF指向像素坐标 [英] Matlab SURF points to pixel coordinates

查看:763
本文介绍了Matlab SURF指向像素坐标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从返回的SURF点中提取(x,y)像素坐标,例如这里使用Matlab提供的示例。很明显,使用'ptsIn(1).Location'我可以返回该点的(x,y)坐标。但重新调整的点数也包括一些小数点,例如(102.9268,51.7285)。有没有办法将其转换为图像平面中的像素位置,或者只是平均这些值将给出像素位置?谢谢。

I want to extract (x,y) pixel coordinates out of the SURF points returned, as an example in the example provided here using Matlab. It is clear that using 'ptsIn(1).Location' I can return the (x,y) coordinates of the point. But the points retuned included some decimal points as well, as an example (102.9268, 51.7285). Is there any way to convert this to pixel positions in the image plane, or just averaging these values will give the pixel positions? Thank you.

推荐答案

为了进一步理解,我尝试了以下代码在此链接中

To understand it further I tried the following code in this link.

% Extract SURF features
  I = imread('cameraman.tif');
  points = detectSURFFeatures(I);
  [features, valid_points] = extractFeatures(I, points);

% Visualize 10 strongest SURF features, including their 
% scales and orientation which were determined during the 
% descriptor extraction process.
  imshow(I); hold on;
  strongestPoints = valid_points.selectStrongest(10);
  strongestPoints.plot('showOrientation',true);

然后,尝试命令 strongestPoints.Location 在Matlab控制台中,返回以下(x,y)坐标。

Then, tried the command strongestPoints.Location in the Matlab console, which returned the following (x,y) coordinates.

139.7482 95.9542
107.4502 232.0347
116.6112 138.2446
105.5152 172.1816
113.6975 48.7220
104.4210 75.7348
111.3914 154.4597
106.2879 175.2709
131.1298 98.3900
124.2933 64.4942

139.7482 95.9542 107.4502 232.0347 116.6112 138.2446 105.5152 172.1816 113.6975 48.7220 104.4210 75.7348 111.3914 154.4597 106.2879 175.2709 131.1298 98.3900 124.2933 64.4942

由于有一个坐标(107.4502 232.0347),我试图将行232标记为黑色( I(232,:)= 0; )以查看它是否匹配在SURF点进行232.0347 y坐标,并得到如下图。因此,似乎SURF点的舍入值给出图像的(x,y)像素坐标。

Since there is a coordinate (107.4502 232.0347), I tried to mark the row 232 as black (I(232,:)=0;) to see whether it matches 232.0347 y coordinate in the SURF point, and received the following figure. So it seems rounded values of the SURF points give the (x,y) pixel coordinates of the image.

这篇关于Matlab SURF指向像素坐标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆