In this paper, we present a new algorithm to automate the detection and extraction of buildings from satellite images, this algorithm is distinguished since it overcomes some obstacles that limit detecting within other methods, such as the difference in shape, color, and height of buildings, and it doesn't need multi-spectral images or other complex and high cost images.