Fitting gaussian to image histogram

