6 #include <cairo/cairo.h>
18 #ifndef CAIRO_HAS_PNG_FUNCTIONS
19 #error LOST requires Cairo to be compiled with PNG support
41 std::ostream &
Stream() {
return *stream; };
83 #define LOST_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg) \
84 type prop = defaultVal;
86 #undef LOST_CLI_OPTION
133 bool shotNoise,
int oversampling,
134 int numFalseStars,
int falseMinMagnitude,
int falseMaxMagnitude,
149 std::vector<unsigned char> imageData;
191 std::unique_ptr<Stars>
stars =
nullptr;
192 std::unique_ptr<StarIdentifiers>
starIds =
nullptr;
243 std::unique_ptr<CentroidAlgorithm> centroidAlgorithm;
246 int centroidMinMagnitude = 0;
247 int centroidMinStars = 0;
249 std::unique_ptr<StarIdAlgorithm> starIdAlgorithm;
250 std::unique_ptr<AttitudeEstimationAlgorithm> attitudeEstimationAlgorithm;
251 std::unique_ptr<unsigned char[]> database;
258 const std::vector<PipelineOutput> &actual,
279 const Stars &expectedStars,
const Stars &inputStars);
288 #define LOST_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg) \
289 type prop = defaultVal;
291 #undef LOST_CLI_OPTION
An attitude estimation algorithm estimates the orientation of the camera based on identified stars.
The attitude (orientation) of a spacecraft.
A full description of a camera. Enough information to reconstruct the camera matrix and then some.
An algorithm that detects the (x,y) coordinates of bright points in an image, called "centroids".
Commannd line options when using the database command.
An 8-bit grayscale 2d image.
unsigned char * image
The raw pixel data in the image.
A set of algorithms that describes all or part of the star-tracking "pipeline".
friend Pipeline SetPipeline(const PipelineOptions &values)
Create a pipeline from command line options.
PipelineOutput Go(const PipelineInput &)
Run all stages of a pipeline.
The command line options passed when running a pipeline.
A star idenification algorithm.
An output stream which might be a file or stdout.
~UserSpecifiedOutputStream()
UserSpecifiedOutputStream(std::string filePath, bool isBinary)
Create a PromptedOutputStream which will output to the given file.
std::ostream & Stream()
return the inner output stream, suitable for use with <<
unsigned char * SurfaceToGrayscaleImage(cairo_surface_t *cairoSurface)
Convert a colored Cairo image surface into a row-major array of grayscale pixels.
std::vector< StarIdentifier > StarIdentifiers
const Catalog & CatalogRead()
Read and parse the full catalog from disk. If called multiple times, will re-use the first result.
std::vector< Star > Stars
StarIdComparison StarIdsCompare(const StarIdentifiers &expected, const StarIdentifiers &actual, const Catalog &expectedCatalog, const Catalog &actualCatalog, decimal centroidThreshold, const Stars &expectedStars, const Stars &inputStars)
Compare expected and actual star identifications.
std::vector< MultiDatabaseEntry > MultiDatabaseDescriptor
MultiDatabaseDescriptor GenerateDatabases(const Catalog &catalog, const DatabaseOptions &values)
Appropriately create descriptors for all requested databases according to command-line options.
SerializeContext serFromDbValues(const DatabaseOptions &values)
std::vector< std::unique_ptr< PipelineInput > > PipelineInputList
PipelineInputList GetPipelineInput(const PipelineOptions &values)
Come up with a list of pipeline inputs based on command line options.
void PipelineComparison(const PipelineInputList &expected, const std::vector< PipelineOutput > &actual, const PipelineOptions &values)
Print or otherwise analyze the results of (perhaps multiple) runs of a star tracking pipeline.
Pipeline SetPipeline(const PipelineOptions &values)
Create a pipeline from command line options.
const char kNoDefaultArgument
std::vector< CatalogStar > Catalog
cairo_surface_t * GrayscaleImageToSurface(const unsigned char *image, const int width, const int height)
std::ostream & operator<<(std::ostream &os, const Camera &camera)
Print information about the camera in machine and human-readable form.
The result of running a pipeline.
Catalog catalog
The catalog that the indices in starIds refer to.
long long centroidingTimeNs
How many nanoseconds the centroiding stage of the pipeline took.
std::unique_ptr< Stars > stars
long long attitudeEstimationTimeNs
std::unique_ptr< Attitude > attitude
std::unique_ptr< StarIdentifiers > starIds
The result of comparing an actual star identification with the true star idenification,...
int numCorrect
The number of centroids in the image which are close to an expected centroid that had an expected ide...
int numTotal
The number of centroids sufficiently close to a true expected star.
int numIncorrect
The number of centroids which were either: