A robust method for the localization of frames within document images is presented. It aims at detecting regions delimited by closed polygonal lines or edges in complex color, gray-level or binary images. In order to reduce computation time and to return only the desired regions, the method exploits information about the frames to be detected such as shape, skew or size, possibly supplied by the user. If no information is available, generic polygons are searched for. Preliminary experiments on several classes of documents with different frame models are promising.