Nonsubsampled shearlet transform is first used to detect cracks of magnetic tile. A filtering using envelope gray level gradient is proposed for background correction. A shearlet coefficient variance discriminator is used to detect cracks. A novel machine vision system has verified the validity of the proposed algorithm. The proposed method is effective in detecting cracks longer than 0.9 mm.