Matlab SURF点转换为像素坐标

3
我希望从返回的SURF点中提取出(x,y)像素坐标,例如使用Matlab提供的这个示例。通过使用“ptsIn(1).Location”,可以返回点的(x,y)坐标,但是返回的点中包含了一些小数位,例如(102.9268,51.7285)。 有没有办法将其转换为图像平面中的像素位置,或者仅平均这些值将给出像素位置?谢谢。
1个回答

2
为了更好地理解,我尝试了以下代码在此链接中
% 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);

然后,在Matlab控制台中尝试了命令strongestPoints.Location,返回以下(x,y)坐标。
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)像素坐标。 enter image description here

2
这是正确的。detectSURFFeatures 可以使用亚像素精度检测感兴趣点。因此,如果您可以通过执行 round(points.Location) 来获取相应像素的 x、y 坐标。 - Dima

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接