From e4523315b90f89562aba8eb7cbc39245b21d1a2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Rapa=C5=88?= <71029912+davidrapan@users.noreply.github.com> Date: Mon, 14 Sep 2020 11:55:01 +0200 Subject: [PATCH] Update BlobCounterBase.cs Cause algorithm is about finding area around coordinates plus ones are needed (also it was change without any research and also adjusting code on row 1306). --- Sources/Accord.Imaging/Blob Processing/BlobCounterBase.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Accord.Imaging/Blob Processing/BlobCounterBase.cs b/Sources/Accord.Imaging/Blob Processing/BlobCounterBase.cs index 628fdde48..a1a1b0472 100644 --- a/Sources/Accord.Imaging/Blob Processing/BlobCounterBase.cs +++ b/Sources/Accord.Imaging/Blob Processing/BlobCounterBase.cs @@ -1301,7 +1301,7 @@ private unsafe void CollectObjectsInfo(UnmanagedImage image) { int blobArea = area[j]; - Blob blob = new Blob(j, new Rectangle(x1[j], y1[j], x2[j] - x1[j], y2[j] - y1[j])); + Blob blob = new Blob(j, new Rectangle(x1[j], y1[j], x2[j] - x1[j] + 1, y2[j] - y1[j] + 1)); blob.Area = blobArea; blob.Fullness = (double)blobArea / ((x2[j] - x1[j] + 1) * (y2[j] - y1[j] + 1)); blob.CenterOfGravity = new Accord.Point((float)xc[j] / blobArea, (float)yc[j] / blobArea);