Detecting caries at the margins of restorations