Question

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.

Was it helpful?

Solution

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);

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

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. enter image description here

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top