StarCentroidCOM:

Path: SpacecraftEstimation/StellarAttDet

% Finds the centroid given intensities on n pixels and their coordinates.
   This uses the center of mass method. The center of mass will have
   larger errors if the width of the region of interest goes outside
   the pixel mask. Generally, star measurements on the edge will not
   be reliable due to optical errors so should be discarded if you have
   enough stars that for than n pixels from the edges.

   x is defined in the column direction, y in the row direction.
   iPSF is in the same units as the intensity of the pixel map.

   Type StarCentroidCOM for a demo which will draw the centroid and the
   intensity map. With one output it will return [x0;y0]

   Since version 2014.1.
--------------------------------------------------------------------------
   Form:
   [x0, y0, iC] = StarCentroidCOM( p, threshold, nROI, doPlot )
--------------------------------------------------------------------------

   ------
   Inputs
   ------
   p            (:,:)  Pixel map
   threshold    (1,1)  Threshold indicating a star is present
   nROI         (1,1)  Size of region of interest (pixels)
   doPlot       (1,1)  Specify true to generate the demo plot

   -------
   Outputs
   -------
   x0           (1,:)  x centroid or (3,:) [x0;y0;iPSF]
   y0           (1,:)  y centroid
   iC           (1,:)  Total intensity of the centroid

--------------------------------------------------------------------------
   Reference: M. Knutson and D. Miller, "Fast Star Tracker Centroid
              Algorithm for High Performance CubeSat with Air Bearing
              Validation," June 2012 MIT SSL # 5-12
--------------------------------------------------------------------------

Children:

Common: Graphics/NewFig
Common: Graphics/XLabelS
Common: Graphics/YLabelS
Common: Graphics/ZLabelS
Imaging: PSFUtils/ImagerPSF
Imaging: PSFUtils/RHSGaussianPSF

Back to the SpacecraftEstimation Module page