Regularity of minimizers for a class of anisotropic free discontinuity problems