Shape Detection and Recognition

Click For Summary
Detecting shapes in images can effectively begin with edge detection, which relies on identifying contrasts between a shape and its background. While edge detection is typically effective with high contrast, techniques such as converting images to binary formats can help in cases where contrast is minimal. This involves applying a threshold to classify pixel values, aiding in edge identification.For more complex shape recognition, artificial neural networks are recommended due to their ability to learn from examples and adapt to variations in image scaling, rotation, and translation. These networks can utilize methods like edge matching and feature detection to enhance shape recognition capabilities. Resources such as William K. Pratt's "Introduction to Digital Image Processing" and Anoop Madhusudanan's work on neural networks provide foundational knowledge and practical guidance for those new to the field. Exploring gradient vectors and modeling images with functions can also be effective strategies for edge detection.
ecastro
Messages
249
Reaction score
8
How can I detect shapes in an image using an algorithm? I have heard of using edge detection and from there the shapes can be identified, but how? Also, edge detection only is effective if the shape has a high difference of contrast from its surrounding area, what would be an effective technique if the shape and its surrounding area almost have the same contrast (but, of course, the shape is still visible)?

P. S. This is my first time tackling this problem, any hints or references to get me started and understand more of this field?

Thank you in advance.
 
Physics news on Phys.org
ecastro said:
How can I detect shapes in an image using an algorithm? I have heard of using edge detection and from there the shapes can be identified, but how? Also, edge detection only is effective if the shape has a high difference of contrast from its surrounding area, what would be an effective technique if the shape and its surrounding area almost have the same contrast (but, of course, the shape is still visible)?

P. S. This is my first time tackling this problem, any hints or references to get me started and understand more of this field?

Thank you in advance.

I agree that contrast is probably the best information to rely on when detecting simple edges since they're often associated with abrupt variance of lightning. Algorithms can be designed to be sensitive to certain levels of contrast and thus yield outputs accordingly, deciding for example if certain areas of an image contain edges. This technique is usually robust to illumination changes, so surrounding areas with almost similar contrast shouldn't cause you major problems detecting various types of edges.

For shape recognition, artificial neural networks are usually designed for such needs because of their capacity to learn on exemples. They extract information from training samples and create adapted algorithms to solve problems that are usually more complex. A well-trained neural network designed for shape recognition should have a solid adaptive learning ability, invariant in terms of image scaling, rotation and translation. I can think of many ways neural networks can be designed to recognize shapes : edge matching, using the internal angles, using feature detection, etc. Perhaps fuzzy sets could also be used to improve the neural network's ability to generalize inputs.

That's definitely a path you should look into, there's good documentation available on the subject.
 
Last edited:
h6ss said:
I agree that contrast is probably the best information to rely on when detecting simple edges since they're often associated with abrupt variance of lightning. Algorithms can be designed to be sensitive to certain levels of contrast and thus yield outputs accordingly, deciding for example if certain areas of an image contain edges. This technique is usually robust to illumination changes, so surrounding areas with almost similar contrast shouldn't cause you major problems detecting various types of edges.

Will it be effective if I first convert the image into a binary image to detect edges? I have seen that this kind of conversion has some kind of threshold to classify the pixels to have 0 or 1 as their value.

h6ss said:
For shape recognition, artificial neural networks are usually designed for such needs because of their capacity to learn on exemples. They extract information from training samples and create adapted algorithms to solve problems that are usually more complex. A well-trained neural network designed for shape recognition should have a solid adaptive learning ability, invariant in terms of image scaling, rotation and translation. I can think of many ways neural networks can be designed to recognize shapes : edge matching, using the internal angles, using feature detection, etc. Perhaps fuzzy sets could also be used to improve the neural network's ability to generalize inputs.

That's definitely a path you should look into, there's good documentation available on the subject.

I am not really familiar with neural networks and I'm planning to work these things out from scratch.
 
ecastro said:
Will it be effective if I first convert the image into a binary image to detect edges? I have seen that this kind of conversion has some kind of threshold to classify the pixels to have 0 or 1 as their value.

I'm sure there would be many different ways to proceed. One I can think of is modelling the image with a function and describing edges using partial derivatives. A point which lie on the edge can be detected by finding local maxima or minima of the first derivative and by detecting the zero-crossing of the second derivative. I've heard about other methods using the gradient vector. There are many, you just need to find what's best according to your knowledge and your needs.

A good read on the subject would be William K. Pratt's book Introduction to Digital Image Processing.

ecastro said:
I am not really familiar with neural networks and I'm planning to work these things out from scratch.

That's excellent, it's a very interesting subject! I highly suggest starting with Anoop Madhusudanan's work at Code Project (http://www.codeproject.com/Articles/14342/Designing-And-Implementing-A-Neural-Network-Librar). You're taken through the fundamentals and then taught in a very intuitive way how to program the networks. It's a fantastic introductory document about neural networks, especially for the people that are more programming-oriented.

There are other excellent books on the subject, like James Anderson's An Introduction To Neural Networks and Laurene Fausett's Fundamentals of Neural Networks. I think a good starting point would also be Wikipedia, of course.
 
  • Like
Likes ecastro
Thanks a lot for these references!
 

Similar threads

  • · Replies 19 ·
Replies
19
Views
829
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
18K
  • · Replies 125 ·
5
Replies
125
Views
7K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 31 ·
2
Replies
31
Views
3K