Read and preprocess, mean and histogram