LOST  0.0.1
LOST: Open-source Star Tracker
lost::CenterOfGravityAlgorithm Class Reference

A simple, fast, and pretty decent centroid algorithm. More...

#include <centroiders.hpp>

Inheritance diagram for lost::CenterOfGravityAlgorithm:
Collaboration diagram for lost::CenterOfGravityAlgorithm:

Public Member Functions

 CenterOfGravityAlgorithm ()
 
Stars Go (unsigned char *image, int imageWidth, int imageHeight) const override
 Actually perform the centroid detection. More...
 
- Public Member Functions inherited from lost::CentroidAlgorithm
virtual ~CentroidAlgorithm ()
 

Detailed Description

A simple, fast, and pretty decent centroid algorithm.

Simply finds the weighted average of the coordinates of all bright pixels, the weight being proportional to the brightness of the pixel.

Definition at line 37 of file centroiders.hpp.

Constructor & Destructor Documentation

◆ CenterOfGravityAlgorithm()

lost::CenterOfGravityAlgorithm::CenterOfGravityAlgorithm ( )
inline

Definition at line 39 of file centroiders.hpp.

Member Function Documentation

◆ Go()

std::vector< Star > lost::CenterOfGravityAlgorithm::Go ( unsigned char *  image,
int  imageWidth,
int  imageHeight 
) const
overridevirtual

Actually perform the centroid detection.

This is the "main" function of CentroidAlgorithm.

Parameters
imageAn row-major indexed array of grayscale pixels. 0 is black, 255 is white. The total length is imageWidth * imageHeight
imageWidth,imageHeightImage dimensions in pixels.

Implements lost::CentroidAlgorithm.

Definition at line 158 of file centroiders.cpp.

Here is the call graph for this function:

The documentation for this class was generated from the following files: