title: OpenCV gaussian curve fitting
body: <p>I'm looking for fitting a Gaussian curve using OpenCV.
  I can have 1D or 2D <code>Mat</code>, and I'd like to calculate the Gaussian parameters of the best Gaussian fit over the matrix.
  However, I'd like to be able to fix some parameter (e.g. the Gaussian mean or variance).
  The 1D model I'd like to fit is the following:</p>
  
  <pre><code>y = a + (b - a) * exp( -( x - c )/( 2 * d^2 ) )
  </code></pre>
  
  <p>In the case of 2D <code>Mat</code>, the model is the same of a multi-variate Gaussian function.</p>
  
  <p>Has OpenCV some implementation suitable for my fitting needs?
  If yes, can you provide an example or some useful links?
  Thank you in advance.</p>