Using SURF algorithm to match objects on MATLAB I am trying to find the difference between two images, using Matlab. The classic built in function that Matlab provides for this is because the two images don't have the same dimensions (The objects in the images are the same, but in the second image other objects are introduced).
i need to use a metric or function can calculate the number of matching feature between two images and give me a value to decide according to threshold .. 

source = imread('source.png');
target = imread('target.png');
source = rgb2gray(source);
target = rgb2gray(target);
  sourcePoints=detectSURFFeatures(source,'MetricThreshold',100.0,'NumOctaves',1,'N   umScaleLevels',6);
 targetPoints=detectSURFFeatures(target,'MetricThreshold',100.0,'NumOctaves',1,'NumScaleLevels',6);
     [sourceFeatures,sourcePoints]=extractFeatures(source,sourcePoints,'SURFSize',64);
     [targetFeatures,targetPoints]=extractFeatures(target,targetPoints,'SURFSize',64);

  boxPairs = matchFeatures(sourceFeatures, targetFeatures);

  matchedSourcePoints = sourcePoints(boxPairs(:, 1), :);
  matchedTargetPoints = targetPoints(boxPairs(:, 2), :);

  % IS there any metric can used to make accurate decision if there is a match or not instead of percentage because its not accurate as required 
  numPairs = length(boxpairs); %the number of pairs
  percentage  = numPairs/100;

     if percentage &gt;= 0.40
     disp('We have this');
       else
     disp('We do not have this');
     disp(percentage);
    end


IS there any metric can used to make accurate decision if there is a match or not instead of percentage because its not accurate as required
People generally use Euclidean distances, just like you do and it works as it is, pretty well. However, if you require further robustness, I propose the following:


Compute the matching both ways: image1->image2 and image2->image and then retrieve only the agreeing matches. This introduces some consensus.
Assuming you have planar patches, you run a homography using RANSAC. The good thing here is that RANSAC is robust to outliers, given a predifined tolerance. This way prune away a lot of matches, and you will be left with a meaningful set of inliers.


Using these two together should really give you robust and repeatable matches.