C# 计算水滴的数量

C# 计算水滴的数量,c#,aforge,C#,Aforge,我正在使用一个RGE C#进行图像处理。如何计算图像中的斑点数(黑色黑色圆圈上的白色斑点)。图像有一个圆形白色斑点(图像已经是二进制格式)。任何想法都将不胜感激。如果您仍在寻找答案,请尝试: BlobCounterBase bc = new BlobCounter(); bc.FilterBlobs = true; bc.MinWidth = N; //give required value or ignore bc.MinHeight = M; //give required value o

我正在使用一个RGE C#进行图像处理。如何计算图像中的斑点数(黑色黑色圆圈上的白色斑点)。图像有一个圆形白色斑点(图像已经是二进制格式)。任何想法都将不胜感激。

如果您仍在寻找答案,请尝试:

BlobCounterBase bc = new BlobCounter();
bc.FilterBlobs = true;
bc.MinWidth = N; //give required value or ignore
bc.MinHeight = M; //give required value  or ignore
bc.CoupledSizeFiltering = true; // if value are given and if you want both Width and Height to be applied as a constraint to identify blob, set it to true
bc.ProcessImage(image);
Blob[] blobs = bc.GetObjectsInformation();

blobs.Count
将为您提供blobs的计数。

如果您手动执行此操作,则需要定位所有白色像素,然后需要按距离对它们进行分组。因此,每一个接触到另一个像素的白色像素都应该被视为一个斑点的一部分。