Optimal histogram partitioning using a simulated annealing technique