6#include <cairo/cairo.h>
14#ifndef CAIRO_HAS_PNG_FUNCTIONS
15#error LOST requires Cairo to be compiled with PNG support
37 std::ostream &
Stream() {
return *stream; };
79#define LOST_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg) \
80 type prop = defaultVal;
129 bool shotNoise,
int oversampling,
130 int numFalseStars,
int falseMinMagnitude,
int falseMaxMagnitude,
145 std::vector<unsigned char> imageData;
187 std::unique_ptr<Stars>
stars =
nullptr;
188 std::unique_ptr<StarIdentifiers>
starIds =
nullptr;
239 std::unique_ptr<CentroidAlgorithm> centroidAlgorithm;
242 int centroidMinMagnitude = 0;
243 int centroidMinStars = 0;
245 std::unique_ptr<StarIdAlgorithm> starIdAlgorithm;
246 std::unique_ptr<AttitudeEstimationAlgorithm> attitudeEstimationAlgorithm;
247 std::unique_ptr<unsigned char[]> database;
254 const std::vector<PipelineOutput> &actual,
275 const Stars &expectedStars,
const Stars &inputStars);
284#define LOST_CLI_OPTION(name, type, prop, defaultVal, converter, defaultArg) \
285 type prop = defaultVal;
287#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.
The command line options passed when running a pipeline.
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.
A star idenification algorithm.
~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
std::vector< MultiDatabaseEntry > MultiDatabaseDescriptor
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.
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::ostream & operator<<(std::ostream &output, const Vec2 &vec)
std::vector< CatalogStar > Catalog
cairo_surface_t * GrayscaleImageToSurface(const unsigned char *image, const int width, const int height)
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: