9#include <unordered_set>
21 for (
int i = 0; i < numStars; i++) {
53 for (
long i = 0; i <
total; i++) {
56 for (
int i = 0; i < 256; i ++) {
59 for (
int i = 0; i < 256; i ++) {
63 if (
wB > 0 &&
wF > 0) {
128 std::vector<bool>
visited(
n,
false);
130 for (
long i = 0; i <
n; i++) {
131 if (image[i] >= cutoff && !
visited[i]) {
138 std::vector<long>
queue = {i};
141 while(!
queue.empty()) {
150 p.magSum += image[
ind];
151 p.xCoordMagSum += x * image[
ind];
152 p.yCoordMagSum += y * image[
ind];
154 if (x >
p.xMax)
p.xMax = x;
155 if (x <
p.xMin)
p.xMin = x;
156 if (y >
p.yMax)
p.yMax = y;
157 if (y <
p.yMin)
p.yMin = y;
171 if (isValid &&
p.magSum > 0) {
203 p->checkedIndices.insert(i);
205 if (image[i] >
p->maxIntensity) {
206 p->maxIntensity = image[i];
236 if (image[i] >=
p.cutoff &&
p.checkedIndices.count(i) == 0) {
Stars Go(unsigned char *image, int imageWidth, int imageHeight) const override
Actually perform the centroid detection.
Stars Go(unsigned char *image, int imageWidth, int imageHeight) const override
Actually perform the centroid detection.
Stars Go(unsigned char *image, int imageWidth, int imageHeight) const override
Actually perform the centroid detection.
A "centroid" detected in an image.
#define DECIMAL_POW(base, power)
int OtsusThreshold(unsigned char *image, int imageWidth, int imageHeight)
int BadThreshold(unsigned char *image, int imageWidth, int imageHeight)
std::vector< Star > Stars
void IWCoGHelper(IWCoGParams *p, long i, unsigned char *image, int imageWidth, int imageHeight, std::vector< int > *starIndices)
void SerializePrimitive(SerializeContext *ser, const T &val)
int BasicThresholdOnePass(unsigned char *image, int imageWidth, int imageHeight)
int BasicThreshold(unsigned char *image, int imageWidth, int imageHeight)
CentroidParams(int x, int y)
std::unordered_set< int > checkedIndices