0

I’m new to MATLAB. I’m using VL_Feat library. I’m trying to construct a code that can calculate number of matching points between two images. Up to now I know how to match two images. What I want to get is number of matching points.

As an example “X key points found in image 1” “Y key points found in image 2” “z matches”

Can anyone help me?

im1Path = fullfile(vl_root, 'data', 'roofs1.jpg') ;
im2Path = fullfile(vl_root, 'data', 'roofs2.jpg') ;

im1 = imread(im1Path) ;
im2 = imread(im2Path) ;


[f1,d1] = vl_sift(im2single(rgb2gray(im1))) ;
[f2,d2] = vl_sift(im2single(rgb2gray(im2))) ;

[matches, scores] = vl_ubcmatch(d1,d2) ;

fprintf(' %d a counts.\n', vl_ubcmatch(d1,d2));
  • What exactly is your problem here? The `fprintf`-statement? Or the returned `matches` from `vl_ubcmatch`? – Schorsch Jun 19 '13 at 10:32
  • That fprintf is probably going to give you loads and loads of outputs. Try instead `fprintf(' %d a counts.\n', numel(matches));` – Hugh Nolan Jun 19 '13 at 10:42
  • @HughNolan I think it works. Thank you. Can you tell me how to print number of key points in each image? As an example “600 keypoints found in im1”, “720 keypoints found in im2” – Chathuranga Bandara Jun 21 '13 at 18:37

1 Answers1

0

As I understand you want to find the no of keypoints of the two images separately.the given statements below will not produce the exact output you want but I hope this will help you to some extent. this also show some important info regarding the keypoints. If the two images are I & J,then after reading the two images you can add these lines-

I = single(rgb2gray(I));
vl_covdet(I,  'verbose');
J = single(rgb2gray(J));
vl_covdet(J,  'verbose');

and then rest of the codes.

tishaRUET
  • 1
  • 1