In ultrasound exams of obese patients and the breast, the spatial and contrast resolutions of ultrasound images are severely deteriorated when a constant sound speed corresponding to soft tissue is used in receive dynamic beamformation. This degradation is due to the defocusing of the ultrasound beam because of the disparity in sound speed between soft tissue and fatty layers. To minimize the degradation, this paper proposes a new method of estimating an optimal sound speed that can be used to achieve the best beamforming performance in a region of interest (ROI). The proposed method employs a new focusing quality factor (FQF) as an indicator of how well the focusing is conducted with a given sound speed. The FQF is closely associated with the degree of edge conspicuity, which can be obtained using the proposed modified nonlinear anisotropic diffusion (MNAD) technique. To calculate FQF, ultrasound images are formed with different sound speeds ranging from 1400 to 1600 m/s and, subsequently, the ROI is chosen. In the ROI, the degrees of edge conspicuity (i.e., FQF) are calculated. The sound speed can be considered an optimal one for the ROI if it is used to construct the image that provides the maximum FQF. The performances of the proposed method were evaluated through simulation and in vitro experiments with a tissue-mimicking phantom. The performance was also compared with that of the conventional image-based method employed in a commercial ultrasound imaging system. The experimental results demonstrated that the proposed method is capable of estimating an optimal sound speed with an error of 10 m/s regardless of whether strong targets are included in the ROI or not. On the other hand, the conventional image-based method generated an estimation error of 60 m/s maximally in the case in which there were no strong targets in ROI. This indicates that the proposed method is a useful tool to improve ultrasound image quality for clinical applications, especially for ultr- sound exams of obese patients and the breast.