I've been writing a Java program that aides in cutting and working with sprites, such as CSS sprites. The main idea is that the image is segmented into subregions, so the software understands the "spritesheet" is composed of multiple sprites.
The algorithm I developed works by scanning horizontal (x) and vertical (y) axes for breaks, based on transparency/color mask. This doesn't detect each subpart, but applying it recursively may. The 1D axes are transformed into rectangles of where parts are in the image.
http://en.wikipedia.org/wiki/Image%5Fsegmentation
The Wikipedia article (above) has information on many different techniques. One important thing is that I'm not doing recognition, such as detecting foreground objects. Technically using the color mask is separation of a background and foreground though.