Advances in the area of computerized image analysis applied to mammography may have very important practical applications in automatically detecting asymmetries (masses, architectural distortions, etc.) between the two breasts. We have developed a fully automatic technique to detect the breast border and the nipple, this being a necessary prerequisite for further image analysis. To detect the breast border, an algorithm that computes the gradient of gray levels was applied. To detect the nipple, three algorithms were compared (maximum height of the breast border, maximum gradient, and maximum second derivative of the gray levels across the median-top section of the breast). A combined method was also designed. The algorithms were tested on 156 digitized mammograms. The breast segmentation results were evaluated by two expert radiologists and one physicist. In 89% of the mammograms, the computed border was in close agreement with the radiologist's estimated border. Segmentation results were acceptable to be used in computer-aided diagnostic schemes. The mean distance between the position of the nipple indicated by two radiologists by consensus and the position calculated by the computer was 6 mm.