Fitting a gaussian image using opencv
It doesn't seem quite as obvious as you say. I can't manage to retrieve the value of sigma with moments. Here's a reproductible code :

import cv2
import numpy as np

for i in range(1,100,5):
    x, y = np.meshgrid(np.linspace(-1,1,250), np.linspace(-1,1,250))
    d = np.sqrt(x*x+y*y)
    sigma, mu = i/100, 0.0
    im = np.exp(-( (d-mu)**2 / ( 2.0 * sigma**2 ) ) )
    ms = cv2.moments(im)

    w = np.sqrt(ms['mu20']/ms['m00'])
    h = np.sqrt(ms['mu02']/ms['m00'])

    x = ms['m10']/ms['m00']
    y = ms['m01']/ms['m00']

    #w,h should be proportionnal to sigma
    print(x,w,y,h)


which outputs :

124.50000000000003 1.2450000000043133 124.5 1.2450000000067136
124.50000000000004 7.46999999999997 124.50000000000004 7.469999999999793
124.5 13.695000000000055 124.50000000000003 13.694999999999826
124.49999999999996 19.919999860176716 124.49999999999991 19.91999986017709
124.49999999999994 26.14445837769508 124.49999999999991 26.144458377695315
124.50000000000004 32.341175190026235 124.50000000000003 32.341175190026235
124.49999999999996 38.330785155074466 124.49999999999999 38.330785155074466
124.50000000000007 43.78215361374663 124.50000000000001 43.78215361374682
124.50000000000001 48.456482631148084 124.49999999999999 48.4564826311482
124.50000000000001 52.311348835800736 124.49999999999997 52.311348835800885
124.49999999999997 55.43113033682788 124.49999999999996 55.43113033682795
124.50000000000006 57.94254510306185 124.50000000000007 57.942545103061796
124.50000000000004 59.96906667795289 124.50000000000007 59.96906667795291
124.50000000000003 61.614844668595225 124.50000000000001 61.61484466859529
124.49999999999996 62.96253286135033 124.50000000000004 62.96253286135014
124.5 64.07604806231855 124.50000000000003 64.07604806231855
124.5 65.00437844448308 124.50000000000003 65.00437844448301
124.49999999999996 65.78506419998082 124.49999999999999 65.78506419998084
124.5 66.44700119861258 124.50000000000001 66.44700119861257
124.49999999999999 67.01258437680303 124.50000000000003 67.01258437680295


I tried other approaches but nothing seems to work.

I'd like to have the sigma in number of pixels, or the actual sigma from the gaussian definition, but i can retrieve neither. Would you tell me a bit more about how to proceed please ?

(ps I'm sorry I don't have the reputation points to comment directly your answer, which is weird)