An algorithm used to inspect and extract crack defects from weld image is developed in this paper. In this algorithm the weld image is dealt with based on Laplacian operator with offset, and 12 dictionary models for the processed image are established with allowable structure. Effective searching method is provided by the application of dictionary, more context-dependent information is extracted from neighborhood context. Then noise can be effectively reduced and crack defects can be extracted. Experimental results show that longitudinal crack can gain better uninterrupted edges and clearer outline using this algorithm. This algorithm possesses better noise resistance and is a class of inspectionmethod of faint crack.