I am trying to extract features from an image, but I have failed to get the points that I want to extract, and hence my image fails to match with the template.

Are there any checkpoints that I have to go through before applying SIFT to my image so that I get good results? For example the template image is;
enter image description here

targeted image; enter image description here

  • 1
    $\begingroup$ Depends on the kind of image and what you want to use the features for. More info please. $\endgroup$
    – Junuxx
    Commented May 21, 2012 at 17:44

3 Answers 3


What you are supposed to do when matching a template to an image using sift is to run sift against your template and then look for those sift features in that arrangement in your scene.

Rule of thumb: Compare like to like.

Sift(Template) Contained Within Sift(Image)

You cannot tune Sift to extract the "features you want" Sift *uses invariant measures to find features that it believes are most salient. (*Chris A)

If you want it to find particular features from your template make smaller templates of those features and search for them.

Just a suggestion. I do not know exactly what type of template you are trying to fit to what type of scene or image.

  • 7
    $\begingroup$ +1, I agree. Except for one thing. SIFT doesn't find features that are most invariant. It uses invariant measures to find features that it believes are most salient. $\endgroup$
    – Chris A.
    Commented May 21, 2012 at 16:26

I'm not sure if you just want to match two images (e.g. find the common points), or you want to attempt something like CBIR (Content-based image retrieval -- searching a database with a template image to find all that contain the object).

I am currently doing CBIR research, so I am pretty up-to-date with current methods. Here and here are the links to my answers to problems similar to yours from stackoverflow, you should take a look.

Now, to talk about SIFT a little bit. When if was first introduced by Lowe, the term SIFT applied both to the process of feature detection and to the feature descriptors calculated on those detected interest points. Up to this day, the SIFT descriptors have proven to be unbelievably awesome. The descriptors have some cool properties that @Totero already mentioned.

SIFT detection method, on the other hand, which is nowadays more and more referred to as DoG (Difference of Gaussians), is not state-of-the-art any more. It is still widely used, but for the process of feature detection, there are more methods today, some of which are better or nicely complement the types of invariant keypoints DoG process extracts.

Most current papers (look at the links in the linked stackoverflow questions) have one more nice practice: they combine multiple ways of detecting features, and then use SIFT descriptors (which still rock as descriptors) to calculate the invariant vector representations. I am currently working with a combination of DoG (they focus on corner-like parts of images) and MSER regions (they focus on blob-like distinguished points through multiple scales). You might want to try and experiment and throw even more type of feature detectors in there, if you find this combination not satisfactory on your particular image database.

Also, if you are interested, here is a paper that evaluates the preformances of different detection and descriptor combinations. I have not read it since DoG&MSER + SIFT works fine for me, but I've skimmed it and the paper is quite good.

PS: use google scholar if you do not have access to the IEEEXplore database I linked to.

  • $\begingroup$ just a small clarification: DoG stands for Difference of Gaussian (difference between two gaussian filter responses) $\endgroup$
    – Libor
    Commented May 26, 2012 at 20:44

Building on previous responses:

(1) You can use SIFT (or another improved variant of this local-patch descriptor) with dense sampling, instead of the inbuilt detector. You can choose the size of the local patch and the sampling density to suit your requirements of performance and computational cost.

(2) SIFT is an affine invariant descriptor for wide baseline stereo matching. This means that SIFT works well when you take an image and induce affine transform to it, wherein the 'template' must be present in the target image albeit with transforms.

Suggestions: (a) Create a database of template images (if possible) to improve your chances of detecting the image.

(b) You can use BoW model as baseline if you choose to adopt a CBIR approach to your task.

(c) Crop your template image to only the relevant part and use a highly dense SIFT. http://www.vlfeat.org/overview/dsift.html

(4) Later you may want to try a mutli-scale descriptor like PHOG (Pyramidal Histogram of Gradients), etc. which could potentially improve results. http://www.vlfeat.org/overview/dsift.html#tut.dsift.phow


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.