In the realm of digital image applications, image processing technology occupies a pivotal position, with image segmentation serving as a foundational component. As the digital image application domain expands across industries, the conventional segmentation techniques increasingly challenge to cater to modern demands. To address this gap, this paper introduces an MCMC-based image segmentation algorithm based on the Markov Random Field (MRF) model, marking a significant stride in the field. The novelty of this research lies in its method that capitalizes on domain information in pixel space, amplifying the local segmentation precision of image segmentation algorithms. Further innovation is manifested in the development of an adaptive segmentation image denoising algorithm based on MCMC sampling. This algorithm not only elevates image segmentation outcomes, but also proficiently denoises the image. In the experimental results, MRF-MCMC achieves better segmentation performance, with an average segmentation accuracy of 94.26% in Lena images, significantly superior to other common image segmentation algorithms. In addition, the study proposes that the denoising model outperforms other algorithms in peak signal-to-noise ratio and structural similarity in environments with noise standard deviations of 15, 25, and 50. In essence, these experimental findings affirm the efficacy of this study, opening avenues for refining digital image segmentation methodologies.