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.