Measurement uncertainty of the computed center of gravity from pixel image Establishing the position of celestial bodies (stars, and other objects) is based on imaging technology. Depending on the resolution of the imaging sensor used, an object is identified by a group of neighboring (bright) pixels. These pixels surround the center of gravity of the detected celestial body.

In image processing, the central position of a round object (a sphere) is generally determined by computing the center of gravity of the pixels surrounding the detected object. The weights are the intensities of the pixels in the vicinity of the brightest (central) pixel.

My question: how is the variance of this center-of-gravity estimate being calculated, within astronomy?
Every pixel value $S_i$ on the detector at $\vec x_i$ has some error $N_i$: CCDs for example have a background noise $N_\text{bkg}$ from read-out electronics, thermal noise, and sky background, plus a Poissonian photon noise $N_S=\sqrt{S}$.  In many cases this noise follows a Gaussian distribution reasonably well.  After subtracting the background, a position measurement

$$ \vec x = \frac{\sum{S_i \vec x_i}}{\sum{S_i}} $$

has the uncertainty

$$ \operatorname{std} \vec x
= \left[\sum_i \left(\frac{\partial x}{\partial S_i} N_i\right)^2 \right]^{1/2}
= \frac{\left[\sum_i
    \left(
      \sum_j\frac{(x_i - x_j) S_j}{\sum_k S_k} N_i
    \right)^2
  \right]^{1/2}}{\sum_k S_k} $$

$$ N_i^2 = N_\text{bkg}^2 + N_{S_i}^2 $$

using Gaussian error propagation ... I hope I have run the math correctly.  The way I've written it is a bit weird, but shows one important property of this method: If you look at the sum over $j$, you can see how the noise of a pixel is basically weighted by the pixel's distance to the centroid result.  The same error on a pixel value has more impact if the pixel is farther away from the centroid.

Better methods account for the uncertainty $N_i$ on pixel values in the first equation already.  You can do this by introducing additional weights in your centroid or go to fitting models, which is the “usual” method in astrometry, as far as I have seen.

This more involved approach to measuring positions uses the point spread function $P(\vec x_i - \vec x_\text{obj})$ of the instrument under given observing conditions.  The model can be an approximation, e.g. a Moffat function, or an empirical model build from unconfused bright stars in the image, e.g. a spline interpolation.  For point sources, the typical least-squares fit of position and flux of the model to an image easily produces results close to the statistical optimum of parameter estimation in terms of uncertainty.  With our modern computing power the easiest way to get the uncertainty for a given model and data noise is often a bootstrapping algorithm.

Of course extended objects require a bit more work in the model, for example assumptions on their shape, as you have given in your question.