opencv:|opencv: SimpleBlobDetector 使用
Mat image = GetDocument()->image;
vector
SimpleBlobDetector::Params params;
params.thresholdStep = 10;
params.minThreshold = 50;
params.maxThreshold = 220;
params.minRepeatability = 2;
params.minDistBetweenBlobs = 10;
params.filterByColor = true;
params.blobColor = 255;
params.filterByArea = true;
params.minArea = 25;
params.maxArea = 5000;
params.filterByCircularity = false;
params.minCircularity = 0.8f;
params.maxCircularity = std::numeric_limits
params.filterByInertia = false;
//minInertiaRatio = 0.6;
params.minInertiaRatio = 0.1f;
params.maxInertiaRatio = std::numeric_limits
params.filterByConvexity = true;
//minConvexity = 0.8;
params.minConvexity = 0.95f;
params.maxConvexity = std::numeric_limits
double tt=getTickCount();
Ptr blobDetect=SimpleBlobDetector::create(params);
blobDetect->detect(image, keyPoints);
OutInfo("SimpleBlobDetector time",(getTickCount()-tt)*1000/getTickFrequency());
OutInfo("keypoints count",(long)keyPoints.size());
drawKeypoints(image, keyPoints, image, Scalar(0,255,0));
namedWindow("blobs");
imshow("blobs", image);
【opencv:|opencv: SimpleBlobDetector 使用】
文章图片
推荐阅读
- 由浅入深理解AOP
- 【译】20个更有效地使用谷歌搜索的技巧
- mybatisplus如何在xml的连表查询中使用queryWrapper
- MybatisPlus|MybatisPlus LambdaQueryWrapper使用int默认值的坑及解决
- MybatisPlus使用queryWrapper如何实现复杂查询
- opencv|opencv C++模板匹配的简单实现
- Java|Java OpenCV图像处理之SIFT角点检测详解
- iOS中的Block
- Linux下面如何查看tomcat已经使用多少线程
- 使用composer自动加载类文件