-
Notifications
You must be signed in to change notification settings - Fork 3
Feature: Implementing Algorithm Superclass #47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
63e64b8
719dbbf
5c6d4a5
b2a7b9b
59a98e7
35f4729
db0e9aa
8fed43f
0351c0b
04b4265
0a7de4b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,6 +12,7 @@ | |
| #include "distance/edge.hpp" | ||
| #include "distance/distance.hpp" | ||
| #include "distance/vectorize.hpp" | ||
| #include "distance/edge-filters.hpp" | ||
|
|
||
| #include "orbit/orbit.hpp" | ||
|
|
||
|
|
@@ -59,8 +60,6 @@ class CalibrationPipelineExecutor : public PipelineExecutor { | |
| const CalibrationOptions options_; | ||
| /// The Calibration pipeline | ||
| CalibrationPipeline pipeline_; | ||
| /// The Calibration Algorithm used | ||
| std::unique_ptr<CalibrationAlgorithm> calibrationAlgorithm; | ||
| }; | ||
|
|
||
| /** | ||
|
|
@@ -75,19 +74,38 @@ class DistancePipelineExecutor : public PipelineExecutor { | |
| ~DistancePipelineExecutor(); | ||
|
|
||
| /** | ||
| * Constructs a DistancePipelineExecutor | ||
| * | ||
| * @param options The options to create the pipeline | ||
| * @param edgeDetectionAlgorithm The edge detection algorithm to use | ||
| * @param distanceAlgorithm The distance determination algorithm to use | ||
| * @param vectorizationAlgorithm The vectorization algorithm to use | ||
| * | ||
| * @pre options.image.image must be point to heap allocated memory. | ||
| * This is guarenteed as long as strtoimage is used to create the image, | ||
| * and it throws an error if the image is not valid. | ||
| * Constructs a DistancePipelineExecutor (no edge-filters) | ||
| * | ||
| * @param options The DistanceOptions to configure the pipeline (moved into the executor) | ||
| * @param edgeDetectionAlgorithm The EdgeDetectionAlgorithm used by the pipeline (moved into the executor) | ||
| * @param distanceAlgorithm The DistanceDeterminationAlgorithm used by the pipeline (moved into the executor) | ||
| * @param vectorizationAlgorithm The VectorGenerationAlgorithm used by the pipeline (moved into the executor) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where did the preconditions go? |
||
| * | ||
| * @pre edgeDetectionAlgorithm, distanceAlgorithm, and vectorizationAlgorithm are non-null and already | ||
| * configured to operate on (Image -> Points -> PositionVector) in that order. | ||
| * @pre Each provided stage is already "ready" (e.g., pipelines passed in were Completed) before transfer. | ||
| */ | ||
| explicit DistancePipelineExecutor(DistanceOptions &&options, | ||
| std::unique_ptr<EdgeDetectionAlgorithm> edgeDetectionAlgorithm, | ||
| std::unique_ptr<DistanceDeterminationAlgorithm> distanceAlgorithm, | ||
| std::unique_ptr<VectorGenerationAlgorithm> vectorizationAlgorithm); | ||
|
|
||
| /** | ||
| * Constructs a DistancePipelineExecutor with an edge-filtering pipeline | ||
| * | ||
| * @param options The DistanceOptions to configure the pipeline (moved into the executor) | ||
| * @param edgeDetectionAlgorithm The EdgeDetectionAlgorithm used by the pipeline (moved into the executor) | ||
| * @param filters A pipeline of edge filtering stages; ownership is transferred to the executor | ||
| * @param distanceAlgorithm The DistanceDeterminationAlgorithm used by the pipeline (moved into the executor) | ||
| * @param vectorizationAlgorithm The VectorGenerationAlgorithm used by the pipeline (moved into the executor) | ||
| * | ||
| * @pre edgeDetectionAlgorithm, filters, distanceAlgorithm, and vectorizationAlgorithm are non-null. | ||
| * @pre filters has been completed (ready) prior to being passed in so it can run as a stage. | ||
| * @pre Stage input/output types align with the Distance pipeline: Image -> Points -> Points -> PositionVector. | ||
| */ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same note, where are my preconditions |
||
| explicit DistancePipelineExecutor(DistanceOptions &&options, | ||
| std::unique_ptr<EdgeDetectionAlgorithm> edgeDetectionAlgorithm, | ||
| std::unique_ptr<EdgeFilteringAlgorithms> filters, | ||
| std::unique_ptr<DistanceDeterminationAlgorithm> distanceAlgorithm, | ||
| std::unique_ptr<VectorGenerationAlgorithm> vectorizationAlgorithm); | ||
|
|
||
|
|
@@ -99,12 +117,6 @@ class DistancePipelineExecutor : public PipelineExecutor { | |
| const DistanceOptions options_; | ||
| /// The Distance pipeline being used | ||
| DistancePipeline pipeline_; | ||
| /// The Edge Detection Algorithm used | ||
| std::unique_ptr<EdgeDetectionAlgorithm> edgeDetectionAlgorithm; | ||
| /// The Distance Determination Algorithm being used | ||
| std::unique_ptr<DistanceDeterminationAlgorithm> distanceAlgorithm; | ||
| /// The Vectorization/Rotation Algorithm being used | ||
| std::unique_ptr<VectorGenerationAlgorithm> vectorizationAlgorithm; | ||
| }; | ||
|
|
||
| /** | ||
|
|
@@ -130,8 +142,6 @@ class OrbitPipelineExecutor : public PipelineExecutor { | |
| const OrbitOptions options_; | ||
| /// The Orbit pipeline | ||
| OrbitPipeline pipeline_; | ||
| /// The Orbit Propagation Algorithm being used | ||
| std::unique_ptr<OrbitPropagationAlgorithm> orbitPropagationAlgorithm; | ||
| }; | ||
|
|
||
| } // namespace found | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ FOUND_CLI_OPTION("output-file" , std::string , outputFile | |
| #define ISDDA "ISDDA" // The IterativeSphericalDistanceDeterminationAlgorithm (ISDDA) | ||
|
|
||
| /// Distance Flags | ||
| // TODO: Remove enable-noop-edge-filter when the first edge filtering algorithm is implemented. | ||
| #define DISTANCE \ | ||
| FOUND_CLI_OPTION("image" , found::Image , image , {} , found::strtoimage(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The image to process (JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC)") \ | ||
| FOUND_CLI_OPTION("calibration-data" , found::DataFile , calibrationData , {defaultDFHead} , found::strtodf(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The calibration data (*.found)" ) \ | ||
|
|
@@ -65,6 +66,8 @@ FOUND_CLI_OPTION("isdda-discrim-ratio" , decimal , ISDDADiscimRati | |
| FOUND_CLI_OPTION("isdda-pdf-order" , int , ISDDAPdfOrd , 2 , atoi(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The Probability Density Function Order for ISSDA (even int)" ) \ | ||
| FOUND_CLI_OPTION("isdda-radius-loss-order" , int , ISDDARadLossOrd , 4 , atoi(optarg) , kNoDefaultArgument, REQ_ASSIGN, "The Radius Loss Order ISSDA (even int)" ) \ | ||
| FOUND_CLI_OPTION("output-file" , std::string , outputFile , "" , optarg , kNoDefaultArgument, REQ_ASSIGN, "The output file (*.found)" ) \ | ||
| FOUND_CLI_OPTION("enable-noop-edge-filter" , bool , enableNoOpEdgeFilter, false , found::strtobool(optarg) , true , OPT_ASSIGN, "Enable the NoOp edge filter (test/demo only)" ) \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a note to remove this upon implementation of the first edge filtering algorithm. Since we do not use NoOp Algorithms, we should not encourage this pattern. |
||
|
|
||
|
|
||
|
|
||
| // Orbit Flags | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.