Pergunta

This question is regarding SIFT features and its use in MATLAB. I have some data containing the following information:

  1. The x,y co-ordinates of each feature point
  2. The scale at each feature point
  3. The orientation at each feature point
  4. The descriptor vector for each feature point. Each vector has 128 components.

I'm having a problem with drawing the keypoints onto the corresponding input image. Does anyone have an idea of how to do this? Are there any built-in functions I can use?

Thanks a lot.

Foi útil?

Solução

If you just want to display the points themselves, read in the x and y co-ordinates into separate arrays, then display the image, use the hold on command, then plot the points. This will overlay your points on top of the image.

Assuming you have these co-ordinates already available and stored as x and y, and assuming you have your image available and stored as im, you can do this:

 imshow(im);
 hold on;
 plot(x, y, 'b.');

Keep in mind that the x co-ordinates are horizontal and increase from the left to right. The y co-ordinates are vertical and increase from top to bottom. The origin of the co-ordinates is at the top left corner, and is at (1,1).

However, if you want to display the detection window, the size of it and the orientation of the descriptor, then suggest you take a look at the VLFeat library as it has a nice function to do that for you.

Suggestion by Rafael Monteiro (See comment below)

You can also modify each point so that it reflects the scale that it was detected at. If you want to do it this way, assume you have saved the scales as another array called scales. After, try doing the following:

 imshow(im);
 hold on;
 for i = 1 : length(x)
      plot(x(i), y(i), 'b.', 'MarkerSize', 10*scales(i));
 end

The constant factor of 10 is pretty arbitrary. I'm not sure how many scales you have used to detect the keypoints and so if the scale is at 1.0, then this would display the keypoint at the default size when plotting. Play around with the number until you get results that you're comfortable with. However, if scale doesn't matter for you, the first method is fine.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top