Detecting cracks in materials