Solved

Shape recognition in VB

Posted on 2004-04-30
15
2,522 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
  • 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
 
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
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

747 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now