image recognition frameworks?

Are there any frameworks for image recognition? I would like to recognize mahjong tiles from photographs -- can any framworks help me, or do I need to do this from scratch? If I need to do this myself, where should I start?