Added calculation of the histograms and the visual metrics