A method is proposed for automatic detection of cracks extracted from 2D images of damaged structures. In the 2D images, the cracks are treated as tree-like topological dark objects of which each tree branch is assumed to be line-like and have local symmetry across the crack center axis. Utilizing the geometric features of the cracks, a novel level set model in which the level set function comprises a set of B-spline basis functions is established to automatically extract the level set function from the 2D crack image with intensity inhomogeneity for crack detection. A new energy functional together with a crack measure technique is introduced to derive an iterative procedure for obtaining the exact level set function of the crack image via an optimization approach. In the iteration process, the level set model can produce smooth and continuous boundaries of the cracks with fast convergence speed. In a comparative study, it has been shown that the proposed method can extract cracks from several real noisy crack images of damaged structures made of various materials more accurate than those determined using the existing crack detection methods which use either different level set models or other image processing techniques in extracting the cracks.