The described subject matter automatically detects the boundaries of multiple
objects in digital image data such as scanned image data. To accomplish this, a
background color such as a scanner lid background color is detected. An edge map
is generated based on a set of transitions between the determined background color
and other colors that correspond to the scanned image data. A set of straight lines,
or boundaries that correspond to one or more objects in the image data is determined
by analyzing the generated edge map. The straight lines are assigned to respective
objects based on a set of rules.