LOST 0.0.1
LOST: Open-source Star Tracker
Loading...
Searching...
No Matches
star-id-private.hpp
Go to the documentation of this file.
1// Stuff that tests need to access, but not part of the public interface
2
3#ifndef STAR_ID_PRIVATE_H
4#define STAR_ID_PRIVATE_H
5
6#include <limits>
7#include <utility>
8#include <vector>
9
10#include "star-id.hpp"
11#include "databases.hpp"
12
13namespace lost {
14
18public:
20 : bestAngleFrom90(std::numeric_limits<decimal>::max()), // should be infinity
21 bestStar1(0,0), bestStar2(0,0),
22 index(index),
23 star(&star) {
24 identifiedStarsInRange.reserve(10); // this does quite measurably improve performance, at least on desktop
25 }
26
27 // "null" has index=-1
29 : bestStar1(0,0), bestStar2(0,0),
30 index(-1) { }
31
36 const Star *star;
37
38private:
39 // possible improvement: Use a tree map here to allow binary search
40 std::vector<std::pair<decimal, StarIdentifier>> identifiedStarsInRange;
41
42private:
43 decimal VerticalAnglesToAngleFrom90(decimal v1, decimal v2);
44
45public:
46 void AddIdentifiedStar(const StarIdentifier &starId, const Stars &stars);
47};
48
49std::vector<int16_t> IdentifyThirdStar(const PairDistanceKVectorDatabase &db,
50 const Catalog &catalog,
53 decimal tolerance);
54
56 const Stars &,
58 const Catalog &,
59 const Camera &,
60 decimal tolerance);
61
62}
63
64#endif
A full description of a camera. Enough information to reconstruct the camera matrix and then some.
Definition camera.hpp:9
unidentified centroid used in IdentifyRemainingStarsPairDistance The "angles" through here are "trian...
const Star * star
Index into list of all centroids.
IRUnidentifiedCentroid(const Star &star, int16_t index)
StarIdentifier bestStar1
For the pair of other centroids forming the triangular angle closest to 90 degrees,...
void AddIdentifiedStar(const StarIdentifier &starId, const Stars &stars)
When a centroid within range of this centroid is identified, call this function.
Definition star-id.cpp:276
StarIdentifier bestStar2
One star corresponding to bestAngleFrom90.
int16_t index
The other star corresponding to bestAngleFrom90.
A database storing distances between pairs of stars.
Definition databases.hpp:54
A "centroid" detected in an image.
Records that a certain Star (detected in the image) corresponds to a certain CatalogStar.
double decimal
Definition decimal.hpp:11
LOST starting point.
std::vector< StarIdentifier > StarIdentifiers
std::vector< Star > Stars
int IdentifyRemainingStarsPairDistance(StarIdentifiers *, const Stars &, const PairDistanceKVectorDatabase &, const Catalog &, const Camera &, decimal tolerance)
Given some identified stars, attempt to identify the rest.
Definition star-id.cpp:461
std::vector< int16_t > IdentifyThirdStar(const PairDistanceKVectorDatabase &db, const Catalog &catalog, int16_t catalogIndex1, int16_t catalogIndex2, decimal distance1, decimal distance2, decimal tolerance)
Given two already-identified centroids, and the distance from each to an as-yet unidentified third ce...
Definition star-id.cpp:384
void SerializePrimitive(SerializeContext *ser, const T &val)
std::vector< CatalogStar > Catalog