1. A method for identifying an object within a container, said method comprising: acquiring image data representing an image; applying a morphological operator to the acquired image data to generate morphed image data in which each image element of the image data is assigned an integer value representing contact with neighboring image elements; calculating, by a processor, a histogram based on the integer values of each image element in the morphed image data; classifying the image using the calculated histogram; and outputting a classification of the image.