Code covered by the BSD License  

Highlights from
Object Matching


3.7 | 5 ratings Rate this file 105 Downloads (last 30 days) File Size: 2.88 MB File ID: #34626
image thumbnail

Object Matching



An object matching method based on Lowe, D.G. Object recognition from local scale-invariant features

| Watch this File

File Information

Object matching method based on Lowe, D.G. Object recognition from local scale-invariant features. Marks the contour of the target in a test image based on 1 target image. Uses SURF points instead of SIFT points.
Need to download SURFmex library first.
See for detail.


Match Plot inspired this file.

Required Products MATLAB
MATLAB release MATLAB 7.6 (R2008a)
Tags for This File   Please login to tag files.
Please login to add a comment or rating.
Comments and Ratings (19)
10 Jun 2014 Li yang Ku

The SURFmex library is now on github
To run the code, open Demo.m in the editor and click run. Make sure you link the SURFmex library, see comments in Demo.m

10 Jun 2014 Roshan Kumar ar

hi sir... how to execute this code..

25 Feb 2014 Wu Feng

Hi Li yang Ku,
I can't open the website of SURFmex library for detail. So could you send me the same one? My email is

Best Regards

06 Mar 2013 Li yang Ku

Yes, it should be able to do this job. Just train it with different QR codes or a QR code with out the middle part.

06 Mar 2013 Saleh

Hi Li yang Ku,
Thank you very much, it is work now.
Do you think this program is applicable to modify to be able to recognize QR-Code? What I need is just detect QR-Code Not read it, which means is this image contains QR-Code or not? I don't need to read it, because I have another program does that job(decoding QR-Code).
Best Regards

05 Mar 2013 Li yang Ku

Hi Saleh, you should double check you have surfpoints.mexw32 in the same folder which surfpoints.m locates in, and also make sure you added the surfmex directory to path. I believe you didn't install surfmex correctly.

05 Mar 2013 Saleh

Hi Li yang Ku,

At last year I was able to run your program, but now I'm facing this problem:
>> Demo
Attempt to execute SCRIPT surfpoints as a function:

Error in createTargetModel (line 18)
[cr, descr, sign, info] = surfpoints(im_mat_g,options);

Error in Demo (line 22)
targetModel = createTargetModel(targetImage, targetModelImage);

Could you help me to fix it? Please...

03 May 2012 Shikhar

Hi Mr. Li,

To what extend, will this code work in my requirement.

Best Regards.

01 Mar 2012 Li yang Ku

Unfortunately this is not a probabilistic method, therefore unlike it doesn't determine an object exist or not base on a probabilistic threshold. However, you should be able to get a degree of confidence based on "length(filter_match)" which is the number of votes remained after filtering. To lower the threshold of finding an object or not, you can modify the parameters I manually set under %check location, %check orientation, %check scale, etc.

01 Mar 2012 Saleh

Mr. Li Yang Ku, could you tell me how can I indicate matching degree. for example: when the algorithm fail to detect the object; I would like to know what was the percentage of matching which based on that percent judged and displayed('object not found')?

Best Regards


17 Feb 2012 Li yang Ku

A pen probably won't work, unless there are words on the pen and you always show the same side of the pen in the test image. Remind that this method uses SIFT like features. SIFT works well on unique patterns with certain size. Some object with a large surface and some special patterns like words will probably work well.

16 Feb 2012 Saleh

Thanks Li yang Ku for quick responce.
I had applied your algorithm to detect a pen rather than a drill,
unfortunatly it has failed.
what are the conditions to design the Model?
Best Regards

15 Feb 2012 Li yang Ku

The object in both the training image and the testing image has to be big enough, otherwise there wont be enough SURF points to recognize. I recommend to start with the model I provided and then move on to something easy like books with text on the cover. Note that this method would not work well on texture less objects. Let me know if you still have problems.

15 Feb 2012 Saleh

when I apply your algorithm on my images, it is unable to find object. May be I have designed the model incorrectly, is there any advise...please


14 Feb 2012 Panimalar

Thank you.
Sir, can I get the full published paper on above object matching, because I cannot find it on the blog you mentioned. Can u please mail the same to me.My ID

30 Jan 2012 Li yang Ku

I am not sure if this algorithm is fast enough for real time, but you can always sub-sample your video and use the same code in a for loop.

30 Jan 2012 Panimalar

I want matlab code to implement these SIFT algorithm in video sequence.
My mail ID

18 Jan 2012 Li yang Ku

Thanks, I added some brief description of the algorithm inside my blog post
The algorithm is published in the paper I mentioned inside the blog post.

18 Jan 2012 Tolga Birdal

Good work. Could you share the matching algorithm you used in this example? Is it published?


Contact us