Surface roughness is an important parameter for the machined parts such as grinding, milling, turning and casting. The conventional digital image processing methods have the capability of detecting the surface roughness of grinding, milling and turning parts. However, these methods can not be utilized to evaluate the surface roughness of castings in that there is no regular or periodic texture in the surface image of casting. Therefore, we proposed a simple but effective texture analysis method to evaluate surface roughness of castings in this paper. The proposed method is based on image partition and edge counting, which are implemented via K-means clustering or watershed transform. Several groups of experiments illustrated that the proposed method is feasible but promising as well.