Detection of objects in images in an automated fashion is necessary for many applications, including automated target recognition. In this paper, we present results of boundary detection using Markov random fields. Once the boundaries of regions are detected, object recognition can be conducted to classify the regions within the boundaries. Thus, an approach that gives good boundary detection is very important in many automated target recognition systems. Our algorithm for boundary detection combines a Bayesian approach with a histogram specification technique to locate edges of objects that have a closed-loop boundary. The boundary image is modeled by a Markov random field. The method is relatively insensitive to the input parameters required by the user and provides a fairly robust automated detection procedure that produces an image with closed one-pixel-wide boundaries. We apply our method to mine data with very good results.