From 32d0226bb59f906f2d5ba10ded7b9d9dc93c47f9 Mon Sep 17 00:00:00 2001 From: Filip Leonarski Date: Wed, 1 Oct 2025 10:54:33 +0200 Subject: [PATCH] SpotUtils: Use filtered spots --- image_analysis/spot_finding/SpotUtils.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/image_analysis/spot_finding/SpotUtils.cpp b/image_analysis/spot_finding/SpotUtils.cpp index f8e534dd..133510e7 100644 --- a/image_analysis/spot_finding/SpotUtils.cpp +++ b/image_analysis/spot_finding/SpotUtils.cpp @@ -49,9 +49,6 @@ void FilterSpotsByCount(std::vector &input, int64_t count) { } std::optional GetResolution(const std::vector &spots) { - if (spots.size() < 6) - return std::nullopt; - std::vector resolutions; resolutions.reserve(spots.size()); @@ -62,7 +59,9 @@ std::optional GetResolution(const std::vector &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(spots.size() * 0.95)]; }