An Intelligent Approach to Detect Cracks on a Surface in an Image