Solved

Shape recognition in VB

Posted on 2004-04-30
15
2,527 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Opening Remote & Local Data Connection 2 51
A macro to Count the number of rows across all worksheets 3 81
Run code from text file in vb 1 56
TT Auto Dashboard 13 83
I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

910 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

23 Experts available now in Live!

Get 1:1 Help Now