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 <cstdint>
7#include <limits>
8#include <utility>
9#include <vector>
10
11#include "camera.hpp"
12#include "databases.hpp"
13
14namespace lost {
15
19public:
21 : bestAngleFrom90(std::numeric_limits<decimal>::max()), // should be infinity
22 bestStar1(0,0), bestStar2(0,0),
23 index(index),
24 star(&star) {
25 identifiedStarsInRange.reserve(10); // this does quite measurably improve performance, at least on desktop
26 }
27
28 // "null" has index=-1
30 : bestStar1(0,0), bestStar2(0,0),
31 index(-1) { }
32
36 int16_t index;
37 const Star *star;
38
39private:
40 // possible improvement: Use a tree map here to allow binary search
41 std::vector<std::pair<decimal, StarIdentifier>> identifiedStarsInRange;
42
43private:
44 decimal VerticalAnglesToAngleFrom90(decimal v1, decimal v2);
45
46public:
47 void AddIdentifiedStar(const StarIdentifier &starId, const Stars &stars);
48};
49
50std::vector<int16_t> IdentifyThirdStar(const PairDistanceKVectorDatabase &db,
51 const Catalog &catalog,
52 int16_t catalogIndex1, int16_t catalogIndex2,
53 decimal distance1, decimal distance2,
54 decimal tolerance);
55
57 const Stars &,
59 const Catalog &,
60 const Camera &,
61 decimal tolerance);
62
63}
64
65#endif
A full description of a camera. Enough information to reconstruct the camera matrix and then some.
Definition camera.hpp:9
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:562
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:56
Records that a certain Star (detected in the image) corresponds to a certain CatalogStar.
A "centroid" detected in an image.
double decimal
Definition decimal.hpp:8
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:747
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:670
std::vector< CatalogStar > Catalog