File Exchange

image thumbnail

Object Matching

version 1.0 (2.88 MB) by

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

39 Downloads

Updated

View License

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 http://computervisionblog.wordpress.com/2012/01/15/object-matching-method-made-in-the-20th-century/ for detail.

Comments and Ratings (33)

Tushar

Tushar (view profile)

Actually i m trying this code on the latest version after downloading the SURFmex but not able to run tusharkaid@gmail.com

Yashaswa Jain

Aisha

Aisha (view profile)

Getting same error..
Attempt to execute SCRIPT surfpoints as a function:
D:\matlab_tests\surfmex-master\mexw64\surfpoints.m

Error in short_example (line 20)
[points descr sign info] = surfpoints(I, options);
 

pravinmu

Li yang Ku,
i'm getting the same error as sanya. i'm using a 64-bit workstation and 64-bit MATLAB version. even the short_example.m file gives the same error. please help.

Yeah, it's a 64-bit workstation and 64-bit MATLAB version.

Li yang Ku

Li yang Ku (view profile)

The surfmex library you have only has mexw64 folder. Are you running on a 64 bit machine and 64 bit matlab? If not you need to create mex files for 32 bit.

I added ObjectMatching and surfmex-master folders to path. Opened surfmex-master\surfmex-master\examples\short_example.m and run it (F5). Still the same error.

https://www.dropbox.com/s/xk4rwyk1gpsouvc/Li%20Yang%20Ku-%20short_example.png?dl=0

Li yang Ku

Li yang Ku (view profile)

Try running surfmex/examples/short_example.m and see if it works. This library may be different from the one I used to work with.

Yes, Ihave included my entire folder named "Dec 2, 2014" (wrt screen shot) in path.

Li yang Ku

Li yang Ku (view profile)

Did you include the SURFmex library by right clicking the folder in Matlab and add subfolders to path?

I am still getting the error:

>> Demo
Attempt to execute SCRIPT surfpoints as a function:
E:\Stereo Vision Workspace\Dec 2, 2014\ObjectMatching-
LiYangKu(MathWorks)\surfmex-master\surfmex-master\mexw64\surfpoints.m

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

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

I am maybe missing out on something which I dont know.

It says
"Attempt to execute SCRIPT surfpoints as a function:
E:\Stereo Vision Workspace\Dec 2, 2014\ObjectMatching-
LiYangKu(MathWorks)\surfmex-master\surfmex-master\mexw64\surfpoints.m
while, in that path there is no surfpoints.m present. There is surfpoints.cpp (under the folder "surfmex-master", downloaded from https://github.com/PetterS/surfmex)

Hi, I am looking forward to use your code in my project. Unfortunately, this is the error I am getting, even though I have included surfmex-master in my path (inside the folder ObjectMatching) (https://github.com/PetterS/surfmex)

Demo()
14 targetImage = imread('TrainImage/drill.bmp');
Attempt to execute SCRIPT surfpoints as a function:
E:\Stereo Vision Workspace\Dec 2, 2014\ObjectMatching- LiYangKu(MathWorks)\surfmex-master\surfmex-master\mexw64\surfpoints.m

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

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

If you wish to know any more details regarding this, let know =)

Li yang Ku

Li yang Ku (view profile)

The SURFmex library is now on github https://github.com/PetterS/surfmex
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

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

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 hawf1988@163.com.

Best Regards

Li yang Ku

Li yang Ku (view profile)

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.

Saleh

Saleh (view profile)

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
     

Li yang Ku

Li yang Ku (view profile)

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.

Saleh

Saleh (view profile)

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:
H:\mayPaper\ObjectMatching\surfmex\SURFmex-v2\mexw32\surfpoints.m

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...

Shikhar

Hi Mr. Li,

To what extend, will this code work in my requirement.
http://www.mathworks.com/matlabcentral/newsreader/view_thread/319690#875552

Best Regards.

Li yang Ku

Li yang Ku (view profile)

Unfortunately this is not a probabilistic method, therefore unlike http://computervisionblog.wordpress.com/2011/12/11/object-recognition/ 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.

Saleh

Saleh (view profile)

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

Saleh

Li yang Ku

Li yang Ku (view profile)

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.

Saleh

Saleh (view profile)

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
Saleh

Li yang Ku

Li yang Ku (view profile)

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.

Saleh

Saleh (view profile)

Hi,
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

Saleh
  

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 abdulkhadir2727@gmail.com

Li yang Ku

Li yang Ku (view profile)

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.

Panimalar

Sir,
    I want matlab code to implement these SIFT algorithm in video sequence.
My mail ID abdulkhadir2727@gmail.com

Li yang Ku

Li yang Ku (view profile)

Thanks, I added some brief description of the algorithm inside my blog post
http://computervisionblog.wordpress.com/2012/01/15/object-matching-method-made-in-the-20th-century/
The algorithm is published in the paper I mentioned inside the blog post.

Tolga Birdal

Tolga Birdal (view profile)

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

Thanks,

MATLAB Release
MATLAB 7.6 (R2008a)
Acknowledgements

Inspired by: Match Plot

Inspired: speed control for alstom gas turbine

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video