An Algorithm for Total Variation Minimization and Applications