diff --git a/src/io.cpp b/src/io.cpp index 1346df21..1ae6dc7e 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -952,6 +952,8 @@ PipelineOutput Pipeline::Go(const PipelineInput &input) { // (human centipede) until there are no more stages set. PipelineOutput result; + std::cerr << *input.InputCamera() << std::endl; + const Image *inputImage = input.InputImage(); const Stars *inputStars = input.InputStars(); const StarIdentifiers *inputStarIds = input.InputStarIds(); diff --git a/src/star-utils.cpp b/src/star-utils.cpp index d510e137..f2a0654f 100644 --- a/src/star-utils.cpp +++ b/src/star-utils.cpp @@ -35,23 +35,23 @@ Catalog NarrowCatalog(const Catalog &catalog, int maxMagnitude, int maxStars, fl // TODO: bug? Why remove both i and j // remove stars that are too close to each other - // std::set tooCloseIndices; - // // filter out stars that are too close together - // // easy enough to n^2 brute force, the catalog isn't that big - // for (int i = 0; i < (int)result.size(); i++) { - // for (int j = i + 1; j < (int)result.size(); j++) { - // if (AngleUnit(result[i].spatial.Normalize(), result[j].spatial.Normalize()) < minSeparation) { - // tooCloseIndices.insert(i); - // tooCloseIndices.insert(j); - // } - // } - // } + std::set tooCloseIndices; + // filter out stars that are too close together + // easy enough to n^2 brute force, the catalog isn't that big + for (int i = 0; i < (int)result.size(); i++) { + for (int j = i + 1; j < (int)result.size(); j++) { + if (AngleUnit(result[i].spatial.Normalize(), result[j].spatial.Normalize()) < minSeparation) { + tooCloseIndices.insert(i); + tooCloseIndices.insert(j); + } + } + } // // Erase all the stars whose indices are in tooCloseIndices from the result. // // Loop backwards so indices don't get messed up as we iterate. - // for (auto it = tooCloseIndices.rbegin(); it != tooCloseIndices.rend(); it++) { - // result.erase(result.begin() + *it); - // } + for (auto it = tooCloseIndices.rbegin(); it != tooCloseIndices.rend(); it++) { + result.erase(result.begin() + *it); + } // and finally limit to n brightest stars if (maxStars < (int)result.size()) {