In this paper we present a fast-recursive fully automated topology-based algorithm for filling in the interiors of objects that appear in a binary image. The algorithm is based on two topological properties of the image contours: perimeter coincidence and interiority. Based on these parameters the algorithm performs a tree-structured region classification. The final filling is done according to the labels of the tree leaves. The algorithm is well suited to cases in which contours overlap and ambiguities may arise about which regions to fill. The algorithm has been tested with three-dimensional solid objects given by surface representations, both for simple man-made CAD objects and for complicated images taken from human computer tomographies. A table shows the execution times taken by the algorithm for several medical volume data sets.