|
|
@ -637,14 +637,20 @@ namespace Emgu.CV.Test |
|
|
|
[Test] |
|
|
|
public void TestSimpleBlobDetector() |
|
|
|
{ |
|
|
|
Mat box = EmguAssert.LoadMat("box.png"); |
|
|
|
SimpleBlobDetectorParams p = new SimpleBlobDetectorParams(); |
|
|
|
p.CollectContours = true; |
|
|
|
SimpleBlobDetector detector = new SimpleBlobDetector(p); |
|
|
|
MKeyPoint[] keypoints = detector.Detect(box); |
|
|
|
using (VectorOfVectorOfPoint contour = detector.GetBlobContours()) |
|
|
|
using (Mat box = EmguAssert.LoadMat("box.png")) |
|
|
|
{ |
|
|
|
int count = contour.Size; |
|
|
|
SimpleBlobDetectorParams p = new SimpleBlobDetectorParams(); |
|
|
|
p.CollectContours = true; |
|
|
|
SimpleBlobDetector detector = new SimpleBlobDetector(p); |
|
|
|
using (Mat mask = new Mat(box.Size, DepthType.Cv8U, 1)) |
|
|
|
{ |
|
|
|
mask.SetTo(new MCvScalar(255)); |
|
|
|
MKeyPoint[] keypoints = detector.Detect(box, mask); |
|
|
|
using (VectorOfVectorOfPoint contour = detector.GetBlobContours()) |
|
|
|
{ |
|
|
|
int count = contour.Size; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|