In response to the issues of over-segmentation, excessive noise, and suboptimal segmentation results commonly encountered in existing image segmentation algorithms based on Markov Random Fields (MRF), this paper proposes an enhanced image segmentation algorithm that integrates MRF with the Sobel operator. The algorithm begins by performing an initial segmentation of the image using a Markov Random Field (MRF)-based method. Subsequently, an enhanced Sobel operator is employed to eliminate noise points and extract fine edge details from the image. Finally, the segmentation result is refined through pixel-wise operations with the edge detection result, resulting in the ultimate segmentation output. The evaluation of segmentation performance is conducted using the Dice coefficient and Mean Hausdorff Distance as assessment metrics. Through experimental analysis, the method in this paper can improve the segmentation effect of the traditional MRF segmentation algorithm, and has better performance and higher adaptivity.