1. A method for automatically identifying objects in an image comprising: receiving a first image formed by data representing physical objects; generating a second image identifying areas of the first image which border regions of different intensities; generating a third image identifying portions of the first image having a respective average gradient magnitude greater than a threshold; processing the second image to produce a fourth image, the fourth image identifying lines in the first image; segmenting the first image into a plurality of regions, wherein the segmenting is based on the third image and the fourth image; determining which of the plurality of segmented regions is a background region not containing said objects; merging adjacent regions which are not background regions; and identifying the objects in the merged adjacent regions.