Search code examples
matlabcomputer-visionfeature-detectionmatlab-cvst

Metrics of SURF detector in matlab


I follow my example link which is find matching points between original image and query image to detect is that query image is in original image or not

when use template ( query image )is in original image work fine , when use query image there is not found in original image appear this problem

that problem is when there is :

MATCHED_POINTS1 ( original image ) and MATCHED_POINTS2 ( query image )
do not contain enough points 

and

Error using affine2d/set.T 
The final column of an affine transformation matrix must consist of zeroes,
except for a one in the last row.

Q : I need to find a metric that count matching points percentage because when applying geometric transform return error due there are no enough matching points ..?

my example link as follow http://www.mathworks.com/help/vision/examples/object-detection-in-a-cluttered-scene-using-point-feature-matching.html


Solution

  • The first error you are getting is thrown by estimateGeometricTransform. You need at least 3 matched pairs of points to estimate the affine transformation. If matchedBoxPoints and matchedScenePoints contain less than 3 points, then you will get this error. You can simply check what size(boxPairs, 1) is. If it is less than 3, you can conclude that the object is not present in the scene.