views:

159

answers:

5

Hi! I wanted to know if there's any way by which we can detect the position of an object in an image using some programming language ?

For example : If i have an image of a ball that is updating itself say every 100 milliseconds,is it possible to get the coordinate of the ball through some program,using something like C++ or Java ?

Thanks!

+7  A: 

Have a look at OpenCV and the Hough Transform.

Gregory Pakosz
I swear AMD/ATi once published a realtime object detection with an implementation of the Hough transform on the GPU - but I can't google it anymore :(
Gregory Pakosz
A: 

If it is your own program, it may be possible. If it is someone else's (third party), it is still possible (but may be tougher).

This problem may actually have more to do with the platform environment (e.g. protection levels across processes) etc rather than the language.

Chubsdad
hmm, suppose i have a webcam,is it possible to program it to read coordinates of a specific object ? using some programming language ?
Anant
If it is your program which captures the image frames, and creates/stores the images as objects, then it could be possible if the image object is accessible.(e.g. it not private). If however, this task has to be done from a seperate process, then it could be tougher and specific imaging algorithms would be required to detect objects in the image(and thereby their position). These could be done in any programming language, assuming no other constraints.
Chubsdad
thank you for the answer! any specific tutorials or guide web pages that you know of that can help me to do this ?
Anant
+1  A: 

Yes, it is.

One method that is often used when you want to detect some fixed predefined object in an image in reasonable time is boosting in combination with haar-like features. You can read up on it in the following papers:

An extended set of haar-like features for rapid object detection

Rapid object detection using a boosted cascade of simple features

TC
+1  A: 

See also:

http://camellia.sourceforge.net

ceeit
A: 

It depends on the complexity of the scene. If the image contains one red ball, in front of a scene that contains no other red objects it is easy:

You select pixels with high values in the red channel, remove stray single pixels (e.g. with "opening"), and compute the center of gravity of the remaining pixels.

If the scene is only slightly more complex the necessary algorithm needs to be much more complex and you must start to read scientific papers, like the ones the TC mentioned. The already mentioned Hough Transform is a relatively simple algorithm that can recognize partially obscured shapes. Therefore, if you want to get away with a simple algorithm, set up the scene carefully and use good illumination with multiple lamps.

For libraries that do the basic image analysis operations, OpenCV and Camellia, that were mentioned already, are the kinds of libraries that you need. For simple algorithms and when you don't need real time, you could also also try the image analysis module from Scipy.

Eike
Someone should also recommend a good introductory book. I don't know any.
Eike