As Kenny has already mentioned, "connected component labeling" describes a family of algorithms that identify connected pixels. Connected components also go by the name of "connected regions" or "blobs", and also by the related concept of "contours." Any such algorithm should be able to find not only a shape of connected foreground pixels, but also the presence of "holes" inside the shape consisting of pixels of the background color.
http://en.wikipedia.org/wiki/Connected-component_labeling
This algorithm is used for several engineering fields that rely on image processing, including computer vision, machine vision, and medical imaging. If you're going to spend any amount of time in image processing, you should become very comfortable with this algorithm and implement at least once on your own.
The OpenCV library has a findContours() function that can be used to find contours, contours within contours, etc.
http://opencv.willowgarage.com/wiki/
If you'd like to see a region-labeling algorithm at work, look for references to "cell counting" using the application ImageJ. Counting biological cells is an important and oft-cited application of region labeling for medical imaging.
http://rsbweb.nih.gov/ij/
Consider getting a textbook on the subject rather than learning piecemeal online. Studying connected components (a.k.a. blobs) inevitably leads to consideration of binarization (a.k.a. thresholding), which takes a grayscale or color image and generates a black and white image from it. If you're working with images from a camera, then lighting becomes critical, and that takes time and tinkering to learn.
There are a host of other preprocessing steps that may be necessary to clean up the image. The need for preprocessing depends on your application.
Here's a textbook that is often recommended, and that gives good coverage of standard image processing techniques:
Digital Image Processing by Gonzalez and Woods, 3rd edition
http://www.imageprocessingplace.com/
Go to addall.com to find cheap copies. International editions are cheaper.
If the characters (or other shapes) in the image are of a consistent size and shape--for example, an "A" is always 40 pixels tall and 25 pixels and machine printed in the same font--then you might use a "normalized cross-correlation" or template-matching technique to identify the presence of one or more matching shapes. This technique can work as a very crude sort of OCR, but has severe limitations.
http://en.wikipedia.org/wiki/Template_matching