Calculate each frame's value of histogram