Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
ollydev committed Dec 17, 2024
1 parent 96b410f commit 7b1bdf4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Tests/matchtemplatemask.simba
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ begin
Assert(Abs(mat[maxLoc.Y, maxLoc.X] - maxValue) <= 0.05);
end;
except
WriteLn(Formula, ' :: ', mat.ArgMin(), ', ', mat.ArgMax(), ', ', Round(mat[mat.ArgMin().Y, mat.ArgMin().X], 1), ', ', Round(mat[mat.ArgMax().Y, mat.ArgMax().X], 1));
WriteLn(Formula, ' :: ', mat.ArgMin, ', ', mat.ArgMax, ', ', Round(mat[mat.ArgMin.Y, mat.ArgMin.X], 1), ', ', Round(mat[mat.ArgMax.Y, mat.ArgMax.X], 1));
raise;
end;
end;
Expand All @@ -31,16 +31,16 @@ begin
try
cache := TMatchTemplateCache.Create(img.toMatrix(), templ.ToMatrix(), formula);
mat := MatchTemplateMask(cache, templ.ToMatrix(), formula);
Assert(mat.ArgMin() = minLoc);
Assert(mat.ArgMax() = maxLoc);
Assert(mat.ArgMin = minLoc);
Assert(mat.ArgMax = maxLoc);

if (minValue <> 0) and (maxValue <> 0) then
begin
Assert(Abs(mat[minLoc.Y, minLoc.X] - minValue) <= 0.05);
Assert(Abs(mat[maxLoc.Y, maxLoc.X] - maxValue) <= 0.05);
end;
except
WriteLn(Formula, ' :: ', mat.ArgMin(), ', ', mat.ArgMax(), ', ', Round(mat[mat.ArgMin().Y, mat.ArgMin().X], 1), ', ', Round(mat[mat.ArgMax().Y, mat.ArgMax().X], 1));
WriteLn(Formula, ' :: ', mat.ArgMin, ', ', mat.ArgMax, ', ', Round(mat[mat.ArgMin.Y, mat.ArgMin.X], 1), ', ', Round(mat[mat.ArgMax.Y, mat.ArgMax.X], 1));
raise;
finally
cache.free();
Expand Down

0 comments on commit 7b1bdf4

Please sign in to comment.