The analysis of the carotid wall is of paramount importance in clinical practice. In fact, the intima-media thickness is a risk index for some of the most severe acute cerebrovascular pathologies; hence, the need for an accurate segmentation of the different layers of the carotid artery. In the past ten years, a wide variety of algorithms for the carotid tunica segmentation have been proposed, but they require a certain degree of user interaction. In this paper we propose a novel approach to the completely user-independent segmentation of the carotid artery wall. Our algorithm has been designed for the extraction of the intima and media layers of the distal carotid wall, based on ultrasonic B-Mode images. We evaluated the performance of the algorithm on a set of 63 images and compared the automatic segmentation to that traced by a trained operator. We obtained a mean error lower than 1.3 pixel both on the intima and media layers, which is comparable to that obtained by means of operator dependent techniques.