我希望从返回的SURF点中提取出(x,y)像素坐标,例如使用Matlab提供的这个示例。通过使用“ptsIn(1).Location”,可以返回点的(x,y)坐标,但是返回的点中包含了一些小数位,例如(102.9268,51.7285)。 有没有办法将其转换为图像平面中的像素位置,或者仅平均这些值将给出像素位置?谢谢。
% 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
,返回以下(x,y)坐标。I(232,:)= 0;
),以查看它是否与SURF点的232.0347 y坐标匹配,并收到以下图像。因此,SURF点的四舍五入值似乎给出了图像的(x,y)像素坐标。
detectSURFFeatures
可以使用亚像素精度检测感兴趣点。因此,如果您可以通过执行round(points.Location)
来获取相应像素的 x、y 坐标。 - Dima