Commit c3ea698d SK

只获取一个圆BUG

1 个父辈 ca84d094
...@@ -434,9 +434,9 @@ namespace Acc.Img ...@@ -434,9 +434,9 @@ namespace Acc.Img
int blobCount = 0; int blobCount = 0;
CvBlobs resultBlobs = new CvBlobs(); CvBlobs resultBlobs = new CvBlobs();
int threshIndex = (startIndex + endIndex) / 2; int threshIndex = (startIndex + endIndex) / 2;
Console.WriteLine("Avg Thresh: " + threshIndex + " blobArea =" + blobArea);
double theArea = blobArea * 0.8; double theArea = blobArea * 0.8;
if (theArea < 1) theArea = 1; if (theArea < 1) theArea = 1;
Console.WriteLine("Avg Thresh: " + threshIndex);
for (int index = startIndex; index < endIndex; index++) for (int index = startIndex; index < endIndex; index++)
{ {
Mat tempThreshMat = new Mat(); Mat tempThreshMat = new Mat();
...@@ -750,7 +750,7 @@ namespace Acc.Img ...@@ -750,7 +750,7 @@ namespace Acc.Img
{ {
item.calOneItem(oneBlobRadius); item.calOneItem(oneBlobRadius);
} }
if (item.isEnd || hasPixToHandle) if (item.isEnd || !hasPixToHandle)
{ {
break; break;
} }
......
...@@ -31,7 +31,7 @@ namespace AccImage ...@@ -31,7 +31,7 @@ namespace AccImage
{ {
//与平均半径差值在10%以内,认为OK //与平均半径差值在10%以内,认为OK
double diff = avgRadius - currentMaxRadius; double diff = avgRadius - currentMaxRadius;
if (diff/avgRadius <= 0.5) if (diff/avgRadius <= 0.4)
{ {
isValid = true; isValid = true;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!