SpotUtils: Use filtered spots
This commit is contained in:
@@ -49,9 +49,6 @@ void FilterSpotsByCount(std::vector<SpotToSave> &input, int64_t count) {
|
||||
}
|
||||
|
||||
std::optional<float> GetResolution(const std::vector<SpotToSave> &spots) {
|
||||
if (spots.size() < 6)
|
||||
return std::nullopt;
|
||||
|
||||
std::vector<float> resolutions;
|
||||
resolutions.reserve(spots.size());
|
||||
|
||||
@@ -62,7 +59,9 @@ std::optional<float> GetResolution(const std::vector<SpotToSave> &spots) {
|
||||
|
||||
std::ranges::sort(resolutions);
|
||||
|
||||
if (spots.size() < 20)
|
||||
if (resolutions.size() < 4)
|
||||
return std::nullopt;
|
||||
if (resolutions.size() < 20)
|
||||
return resolutions[2];
|
||||
return resolutions[static_cast<size_t>(spots.size() * 0.95)];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user