karthick
karthick

Reputation: 12176

Differentiate objects?

i want to identify a ball in the picture. I am thiking of using sobel edge detection algorithm,with this i can detect the round objects in the image.

But how do i differentiate between different objects. For example, a foot ball is there in one picture and in another picture i have a picture of moon.. how to differentiate what object has been detected.

When i use my algorithm i get ball in both the cases. Any ideas?

Upvotes: 2

Views: 1034

Answers (4)

mpenkov
mpenkov

Reputation: 21922

This has been discussed before. Have a look at this question. More info here and here.

Upvotes: 0

florianbaethge
florianbaethge

Reputation: 2560

Well if all the objects you would like to differentiate are round, you could even use a hough transformation for round objects. This is a very good way of distinguishing round objects.

But your basic problem seems to be classification - sorting the objects on your image into different classes.

For this you don't really need a Neural Network, you could simply try with a Nearest Neighbor match. It's functionalities are a bit like neural networks since you can give it several reference pictures where you tell the system what can be seen there and it will optimize itself to the best average values for each attribute you detected. By this you get a dictionary of clusters for the different types of objects.

But for this you'll of course first need something that distinguishes a ball from a moon. Since they are all real round objects (which appear as circles) it will be useless to compare for circularity, circumference, diameter or area (only if your camera is steady and if you know a moon will always have the same size on your images, other than a ball).

So basically you need to look inside the objects itself and you can try to compare their mean color value or grayscale value or the contrast inside the object (the moon will mostly have mid-gray values whereas a soccer ball consists of black and white parts)

You could also run edge filters on the segmented objects just to determine which is more "edgy" in its texture. But for this there are better methods I guess...

So basically what you need to do first:

  1. Find several attributes that help you distinguish the different round objects (assuming they are already separated)
  2. Implement something to get these values out of a picture of a round object (which is already segmented of course, so it has a background of 0)
  3. Build a system that you feed several images and their class to have a supervised learning system and feed it several images of each type (there are many implementations of that online)

Now you have your system running and can give other objects to it to classify.

  1. For this you need to segment the objects in the image, by i.e Edge filters or a Hough Transformation
  2. For each of the segmented objects in an image, let it run through your classification system and it should tell you which class (type of object) it belongs to...

Hope that helps... if not, please keep asking...

Upvotes: 2

Yochai Timmer
Yochai Timmer

Reputation: 49271

That's a question in AI.

If you think about it, the reason you know it's a ball and not a moon, is because you've seen a lot of balls and moons in your life.
So, you need to teach the program what a ball is, and what a moon is. Give it some kind of dictionary or something.

The problem with a dictionary of course would be that to match the object with all the objects in the dictionary would take time.

So the best solution would probably using Neural networks. I don't know what programming language you're using, but there are Neural network implementations to most languages i've encountered.

You'll have to read a bit about it, decide what kind of neural network, and its architecture.

After you have it implemented it gets easy. You just give it a lot of pictures to learn (neural networks get a vector as input, so you can give it the whole picture).
For each picture you give it, you tell it what it is. So you give it like 20 different moon pictures, 20 different ball pictures. After that you tell it to learn (built in function usually).

The neural network will go over the data you gave it, and learn how to differentiate the 2 objects.

Later you can use that network you taught, give it a picture, and it a mark of what it thinks it is, like 30% ball, 85% moon.

Upvotes: 0

Ghassen Hamrouni
Ghassen Hamrouni

Reputation: 3168

When you apply an edge detection algorithm you lose information.

Thus the moon and the ball are the same. The moon has a diiferent color, a different texture, ... you can use these informations to differnentiate what object has been detected.

Upvotes: 1

Related Questions