Visual word coding based on difference maximization