Solved

Shape recognition in VB

Posted on 2004-04-30
15
2,574 Views
Last Modified: 2008-01-09
Hi yall,

i'm looking in to a project where we need to develop a program (preferably in VB.NET) that scans an image and recognizes contours of several similar chapes. After the contours have been recognized i need to compute the measures of each shape and compute those numbers around a bit more.

I've been looking around on the net for libraries and example code of things that can do that, mostly the shape recognition and contour assignment, but i havent been very succesfull. So my question is, firstly is it actually possible to program this (i think it is, but hey i could be wrong), and secondly where could i find more information, libraries / controlles i would need and perhaps even same sample code on the subject?

Any help is appreciated!!
Kind regards,
rigor mortis
0
Comment
Question by:rigor_mortis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 2
  • +1
15 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 10959228
Good luck! ;)
0
 
LVL 4

Author Comment

by:rigor_mortis
ID: 10959262
hehe, i dont hope you want points for that remark ;)
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 10959280
Cute:

An idea though popped up perhaps you can read each pixel and get its color and based on the Color change you can determine what shape it is (same color shapes pending though)
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 
LVL 6

Expert Comment

by:mmusante
ID: 10959466
As I can remember (from the Image Processing course that I followed years ago) the shape recognition is usually made of the following steps:

1) contour extraction (usually made by a convolution mask applied on the image)

2) Removal of isolated pixels (and small groups of pixels too)

3)Recognition of the borders (previously extracted and cleaned) you have to find coordinates of segments that best fit with the contour pixels

I think that VB NET could be a little slow for this purpose but I don't know other problems
0
 
LVL 6

Expert Comment

by:mmusante
ID: 10959489
Do your shapes have some similarity that can simplify your work? Or are you trying to do a more general program?
0
 
LVL 8

Expert Comment

by:bukko
ID: 10959699
Make sure the image doesn't use too many colors.
16 colors would be a good idea.
Then make the the difference between background and foreground flexible so you can try to see which value works best.
Should then be fairly easy to write code to trace the image, then choose waypoints every 100 pixels or so to more clearly define the shape.

Good luck, and I hope this isn't homework.

bukko
0
 
LVL 4

Author Comment

by:rigor_mortis
ID: 10966712
mmusante,

yeah those are the steps i was thinking of as well (sounds like we had the same course :)), the thing just is that i can hardly find any information on how to program that, or where to purchase function libraries that support those steps, and dont even get me started on sample sources on the matter...

So that's really my problem, finding function libraries that incorporate functions to take those steps and some sample code on how to best implement them...

thanks for the help so far guys...
0
 
LVL 4

Author Comment

by:rigor_mortis
ID: 10966726
Bukko,

the supplied image will come from a b/w camera (perhaps with an infrared lamp connected for pictures taken at night), so it's all greyscale.

Well i was thinking of applying a threshold and making it a 2-bit picture, i hope the pictures will be 'clear' enough to make a certain range in the colors 1 and converting the rest to 0. Then cleaning up the picture (removal of isolated pixels as mmusante put it so elequently) and then computing the remaining contours.

I will get some sample pictures on monday, so hopefully i can make an education judgment on whether or not they are usuable...

and no it's not homework :) it's a project for a customer, so well, perhaps you might interpret that as homework :)
0
 
LVL 4

Author Comment

by:rigor_mortis
ID: 10966734
Oh btw, if anybody knows of a good book on the subject, they're welcome to recommend something...
0
 
LVL 6

Expert Comment

by:mmusante
ID: 11003388
Hi I'm back :)

have a look here ... (http://omni.isr.ist.utl.pt/~alex/resources.html)

mostly C and C++ things but two ActiveX too ...

I hope it can help you
0
 
LVL 6

Accepted Solution

by:
mmusante earned 500 total points
ID: 11005935
a lot of links here too but all C or C++
(http://www-2.cs.cmu.edu/~cil/v-source.html)

Autotrace is also interesting ...
(http://autotrace.sourceforge.net/)

you can try having a look to the code
may be you get an idea
0
 
LVL 4

Author Comment

by:rigor_mortis
ID: 11170269
Hey guys,

sorry for my abscence, was on holiday last couple of weeks. I'll check out the links asap and get back to you lot.
0
 
LVL 4

Author Comment

by:rigor_mortis
ID: 11433644
sorry for the delay, the project is still on hold because we haven't sorted out the camera problem yet, i.e. getting decent, workable, feed to the computer... i'll accept mmusante's answers because he put in the most effort and because his links will prove helpfull once the thing finally gets from the ground...

kind regards,
rigor mortis
0
 
LVL 6

Expert Comment

by:mmusante
ID: 11433693
Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question