FOUND
|
The IterativeSphericalDistanceDeterminationAlgorithm is a variation of the SphericalDistanceDeterminationAlgorithm algorithm in that it runs it repeatedly to use all the points given to it. More...
#include <distance.hpp>
Public Member Functions | |
IterativeSphericalDistanceDeterminationAlgorithm (decimal radius, Camera &&cam, size_t minimumIterations, decimal distanceRatio, decimal discriminatorRatio, int pdfOrder, int radiusLossOrder) | |
Creates a IterativeSphericalDistanceDeterminationAlgorithm. | |
~IterativeSphericalDistanceDeterminationAlgorithm ()=default | |
PositionVector | Run (const Points &p) override |
Obtains the position of the planet relative to the camera. | |
![]() | |
SphericalDistanceDeterminationAlgorithm (decimal radius, Camera &&cam) | |
Creates a SphericalDeterminationAlgorithm, which deduces the Position vector of a sattelite from Earth by modeling Earth as a sphere. | |
~SphericalDistanceDeterminationAlgorithm () | |
PositionVector | Run (const Points &p) override |
Obtains the position of the planet relative to the camera. | |
![]() | |
DistanceDeterminationAlgorithm ()=default | |
virtual | ~DistanceDeterminationAlgorithm () |
![]() | |
Stage ()=default | |
Constructs a new Stage. | |
virtual | ~Stage ()=default |
Destroys this. | |
void | DoAction () override |
Executes Run (with a stored input and storing the output) | |
Points & | GetResource () |
Returns the stored input of this. | |
PositionVector *& | GetProduct () |
Returns the stored output of this. | |
Private Member Functions | |
decimal | GenerateLoss (PositionVector &position, decimal targetDistanceSq, decimal targetRadiusSq, std::unique_ptr< Vec3[]> &projectedPoints, size_t size) |
Generates a loss on a position vector. | |
void | Shuffle (size_t size, size_t n, std::unique_ptr< size_t[]> &indicies) |
Shuffles the indexes into triplets, attempting to create triplets whose indicies are far from each other. | |
uint64_t | Pow (uint64_t base, uint64_t power) |
Performs exponentiation for uint64_t. | |
Private Attributes | |
size_t | minimumIterations_ |
The minimum number of iterations to use. | |
decimal | distanceRatioSq_ |
The maximum distance ratio to accept. | |
decimal | discriminatorRatio_ |
The maximum loss ratio to accept. | |
uint64_t | pdfOrder_ |
The Shuffle randomization order. | |
uint64_t | radiusLossOrder_ |
The Loss Radius error order. | |
Additional Inherited Members | |
![]() | |
Vec3 | getCenter (Vec3 *spats) |
Returns the center of earth as a 3d Vector. | |
PreciseDecimal | getRadius (Vec3 *spats, Vec3 center) |
Returns the radius of the calculated "earth" (normalized) | |
PreciseDecimal | getDistance (PreciseDecimal r, PreciseDecimal c) |
Returns the scaled distance from earth. | |
![]() | |
Camera | cam_ |
cam_ field instance describes the camera settings used for the photo taken | |
decimal | radius_ |
radius_ field instance describes the defined radius of earth. | |
![]() | |
Points | resource |
The stored input for this. | |
PositionVector * | product |
The pointer to the stored output for this. | |
The IterativeSphericalDistanceDeterminationAlgorithm is a variation of the SphericalDistanceDeterminationAlgorithm algorithm in that it runs it repeatedly to use all the points given to it.
It uses
test/common/assets/example_earth1.png
:SDDA -> (1.0456e+07, -67903.8, -972.935) m
ISDDA(100000, 0.8, INF, Quadratic Radius Loss AND Randomization) -> (1.0384e+07, -12571.3, -1057.05) m
ISDDA(100000, 0.8, INF, Quartic Radius Loss OR Randomization) -> (1.03781e+07, -11536.7, -927.331) m
In optimized mode (-O3), all algorithms are less than 1 second.
found::IterativeSphericalDistanceDeterminationAlgorithm::IterativeSphericalDistanceDeterminationAlgorithm | ( | decimal | radius, |
Camera && | cam, | ||
size_t | minimumIterations, | ||
decimal | distanceRatio, | ||
decimal | discriminatorRatio, | ||
int | pdfOrder, | ||
int | radiusLossOrder | ||
) |
Creates a IterativeSphericalDistanceDeterminationAlgorithm.
radius | The radius of Earth |
cam | The camera used to capture the picture of Earth |
minimumIterations | The minimum number of iterations to perform |
distanceRatio | The maximum distance error between the evaluated and reference positions to be considered "the same" distance |
discriminatorRatio | The maximum ratio between the evaluated and reference loss to accept for data |
pdfOrder | The Shuffle Randomization Distribution Order |
radiusLossOrder | The Loss Radius Error Order |
|
default |
|
private |
Generates a loss on a position vector.
position | The vector to evaluate |
targetDistanceSq | The target distance squared of the position |
targetRadiusSq | The target "radius" squared |
projectedPoints | The projected points to evaluate against |
size | The size of the projected points |
|
inlineprivate |
Performs exponentiation for uint64_t.
base | The base |
power | The power |
Return base ^ power
|
overridevirtual |
Obtains the position of the planet relative to the camera.
p | The points on the edge of Earth (in the image taken by the camera given to this) |
Implements found::Stage< Points, PositionVector >.
|
private |
Shuffles the indexes into triplets, attempting to create triplets whose indicies are far from each other.
size | The size of indicies, or how many indicies to generate |
n | The end of the range to generate indicies for |
indicies | The array to write into |
|
private |
The maximum loss ratio to accept.
|
private |
The maximum distance ratio to accept.
|
private |
The minimum number of iterations to use.
|
private |
The Shuffle randomization order.
|
private |
The Loss Radius error order.