Monday, June 27, 2011

Real time shape recognition from video feed

Just to keep myself occupied during some "empty" days between courses, I decided to implement a real time shape recognition system in Matlab. Most of the ideas are based on "Shape Recognition and Pose Estimation for Mobile Augmented Reality" by Nate Hagbi et al. However I didn't implement the pose estimation part since I run out of time. Moreover I encountered some difficulties regarding easier parts of the system (oh yeah image retrieval is not my field per se).
   So the idea behind it is simple: locate the most prominent shape (through filtering such as adaptive thresholding), compute its convex hull and perform matching via a bag-of-words approach. Therefore the system firstly needs to be trained. I use SIFT features on a series of projective transformations of the original shape, similar to "Visual Similarity based 3D Shape Retrieval Using Bag-of-Features" by Zhouhui Lian et al. A demonstration is presented below:
You can easily observe some errors; for example whenever the system identifies that a shape exists but doesn't correspond to any of the stored figures, then it matches it to shape "3". Moreover, in order to make the system faster, I forced it to perform matching only when the image difference between frames is higher than a threshold.This leads to no processing whenever quick movements occur. Finally since shape extraction is based on the contrast of an image, then shadows are often misclassified as shapes.
    Anyway, I will upload the code for this sometime in the near future. It's mostly a concatenation of other people's ideas and code but it does the trick. It's also a good starting point for further development.

20 comments:

Anonymous said...

hi im trying to look for this code can u help me?

Jim B. said...

Here it is, hope it helps:

http://www.sendspace.com/file/embkjn

SHYAM said...

Heya¡­my very first comment on your site. ,I have been reading your blog for a while and thought I would completely pop in and drop a friendly note. . It is great stuff indeed. I also wanted to ask..is there a way to subscribe to your site via email?







Function Point Estimation Training

Jim B. said...

Well thanks for your nice words! I guess you can subscribe like all blogs. On the right column of this page, on the "Followers" section you can click on "be the first". Hope it works, although I rarely post these past few months.

Ray said...

Wow! This is just what I'm looking for. Very impressive!

Do you still have the code? The above link is not working...

Jim B. said...

Try this : http://www.sendspace.com/file/sv07rz
I think there's a simple documentation in the zip

jeeeva said...

Jim the file is no more available can you share your source code it will be very useful for my research work.

Jim B. said...

Try this : http://www.sendspace.com/file/aoyw5m

Anonymous said...

Hi,
very very thanks for this.

Please send code for me.
kiarash.s@hotmail.com

thanks.

Anonymous said...

Can i have the code?
giulioromano85@gmail.com

Anonymous said...

HI,
This is really good work.
I apologize in advance to bother you again (like everyone else who wants the code) but could you share it again on a free file hosting site?
thank you

Jim B. said...

Oh I am so sorry I forgot to reply. Here it is: https://www.sendspace.com/file/qa70u6

Mail me if you have problems with it.

Anonymous said...

Thanks a lot for the quick response. much appreciated.

Haris said...

Dear Jim, It is really awesome. Can you please share the source code again?the above shared link file has deleted. If possible, please email me at opam008@hotmail.com

Thanks
HM

Unknown said...

Hi Jim, your work is really great. Can you mail me the code at khandelwalprakhar77@gmail.com. The link is not working

Unknown said...

Hi Jim can you please share the source code for this shape recognition ir is so help full for me.
thank you in advance.
my mail is is katakamnaveen777@gmail.com.

Unknown said...

Hi Jim. Your job is awesome. Can you share code for this shape recognition in this mail: daniel-cieply@wp.pl.
Thank you very much.

Anonymous said...

Hi Jim,can you please share the code for shape recognition.
My email is sindabenselma@gmail.com
Thank you in advance.

Anonymous said...

Hola Jim,

I am Lore from Chile. Can you please share your code with me?
My email is loreto.sanchez@ing.uchile.cl

Thank you very much!

Unknown said...

could you send me the source code
levuanh.hut@gmail.com
thank you in advance