Coronary artery disease (CAD) is the leading cause of death around the world. One of the most common imaging methods for diagnosing CAD is the X-ray angiography (XRA). Diagnosing using XRA images is usually challenging due to some reasons such as, non-uniform illumination, low contrast, presence of other body tissues, and presence of catheter. These challenges make the diagnosis task hard and more prone to misdiagnosis. In this paper, we propose a new method for coronary artery segmentation, catheter detection, and centerline extraction in X-ray angiography images. For the segmentation, initially, three different superpixel scales are exploited, and a measure for vesselness probability of each superpixel is determined. A voting mechanism is used for obtaining an initial segmentation map from the three superpixel scales. The initial segmentation is refined by finding the orthogonal line on each ridge pixel of vessel region. The catheter is detected in the first frame of the angiography sequence and is tracked in other frames by fitting a second order polynomial on it. Also, we use the image ridges for extracting the coronary artery centerlines. We evaluated and compared our method with one of the previous well-known coronary artery segmentation methods on two challenging datasets. The results show that our method can segment the vessels and also detect and track the catheter in the XRA sequences. In general, the results assessed by a cardiologist show that 83% of the images processed by our proposed segmentation method were labeled as good or excellent, while this score for the compared method is 48%. Also, the evaluation results show that our method performs 67% faster than the compared method. Graphical abstract Proposed framework for coronary artery detection.