ImageSpotFinder: Getting ready for abstract class for both CPU and GPU spot finders

This commit is contained in:
2025-10-04 22:25:55 +02:00
parent 1dff8301ff
commit 1a2c234525
9 changed files with 75 additions and 38 deletions
+10 -10
View File
@@ -10,7 +10,7 @@ TEST_CASE("ImageSpotFinderCPU_SignalToNoise") {
ImageSpotFinderCPU s(width, height);
std::vector<int32_t> input (width * height);
int32_t *input = s.GetHostBuffer();
for (int i = 0; i < width * height; i++)
input[i] = (i % 2) * 5 + 5;
@@ -29,7 +29,7 @@ TEST_CASE("ImageSpotFinderCPU_SignalToNoise") {
};
std::vector<bool> mask_resolution(width * height, false);
auto spots = s.Run(input.data(), settings, mask_resolution);
auto spots = s.Run(settings, mask_resolution);
REQUIRE(spots.size() == 2);
REQUIRE(spots[0].RawCoord().y == 25);
@@ -42,7 +42,7 @@ TEST_CASE("ImageSpotFinderCPU_SignalToNoise_Resolution") {
ImageSpotFinderCPU s(width, height);
std::vector<int32_t> input (width * height);
int32_t *input = s.GetHostBuffer();
for (int i = 0; i < width * height; i++)
input[i] = (i % 2) * 5 + 5;
@@ -62,7 +62,7 @@ TEST_CASE("ImageSpotFinderCPU_SignalToNoise_Resolution") {
std::vector<bool> mask_resolution(width * height, false);
mask_resolution[width * 50 + 50] = true;
auto spots = s.Run(input.data(), settings, mask_resolution);
auto spots = s.Run(settings, mask_resolution);
REQUIRE(spots.size() == 1);
REQUIRE(spots[0].RawCoord().x == 26);
@@ -75,7 +75,7 @@ TEST_CASE("ImageSpotFinderCPU_CountThreshold_Resolution") {
ImageSpotFinderCPU s(width, height);
std::vector<int32_t> input (width * height);
int32_t *input = s.GetHostBuffer();
for (int i = 0; i < width * height; i++)
input[i] = (i % 2) * 5 + 5;
@@ -95,7 +95,7 @@ TEST_CASE("ImageSpotFinderCPU_CountThreshold_Resolution") {
std::vector<bool> mask_resolution(width * height, false);
mask_resolution[width * 50 + 50] = true;
auto spots = s.Run(input.data(), settings, mask_resolution);
auto spots = s.Run(settings, mask_resolution);
REQUIRE(spots.size() == 2);
REQUIRE(spots[0].RawCoord().y == 25);
@@ -108,7 +108,7 @@ TEST_CASE("ImageSpotFinderCPU_CountThreshold_Mask") {
ImageSpotFinderCPU s( width, height);
std::vector<int32_t> input (width * height);
int32_t *input = s.GetHostBuffer();
for (int i = 0; i < width * height; i++)
input[i] = (i % 2) * 5 + 5;
@@ -128,7 +128,7 @@ TEST_CASE("ImageSpotFinderCPU_CountThreshold_Mask") {
};
std::vector<bool> mask_resolution(width * height, false);
auto spots = s.Run(input.data(), settings, mask_resolution);
auto spots = s.Run(settings, mask_resolution);
REQUIRE(spots.size() == 3);
REQUIRE(spots[0].RawCoord().x == 26);
@@ -144,7 +144,7 @@ TEST_CASE("ImageSpotFinderCPU_SignalToNoise_Mask") {
size_t height = 100;
ImageSpotFinderCPU s(width, height);
std::vector<int32_t> input (width * height);
int32_t *input = s.GetHostBuffer();
for (int i = 0; i < width * height; i++)
input[i] = (i % 2) * 5 + 5;
@@ -166,7 +166,7 @@ TEST_CASE("ImageSpotFinderCPU_SignalToNoise_Mask") {
};
std::vector<bool> mask_resolution(width * height, false);
auto spots = s.Run(input.data(), settings, mask_resolution);
auto spots = s.Run(settings, mask_resolution);
REQUIRE(spots.size() == 3);
REQUIRE(spots[0].RawCoord().x == 26);