We determine the Gamma-limit as epsilon --> 0 of the sequence integral(Omega)[epsilon phi(2)(x, del u)+epsilon(-1)u(2)(1-u)(2)]dx of functionals defined on H-1(Omega). The free energy density phi has linear growth, is convex and positively homogeneous of degree one in the second variable and is upper semi-continuous in the first variable. The Gamma-limit can be interpreted as a generalized total variation with discontinuous coefficients on the class of the characteristic functions of sets of finite perimeter. The proof is based on some variational properties of the generalized total variation strictly related to the upper semi-continuity of phi, and on constructing a suitable approximation of phi from above.