检测图像中的圆圈 [英] Detecting Circles within an image

查看:124
本文介绍了检测图像中的圆圈的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在使用EmguCV对靶场图像进行形状检测:

I'm currently using EmguCV to run shape detection on an image of a shooting range target:

但是不管我在代码中的设置(如下):

But no matter my settings in the code (below):

double cannyThreshold = 180; double circleAccumulatorThreshold = 170; CircleF[] circles = CvInvoke.HoughCircles(uimage, HoughType.Gradient, 2.0, 1.0, cannyThreshold, circleAccumulatorThreshold, 5);

double cannyThreshold = 180; double circleAccumulatorThreshold = 170; CircleF[] circles = CvInvoke.HoughCircles(uimage, HoughType.Gradient, 2.0, 1.0, cannyThreshold, circleAccumulatorThreshold, 5);

我似乎只能找到三个圈子,其中一个是错误的.

I can only seem to find three circles, of which one is wrong.

我做错了吗?我正在使用

Am I going about this incorrectly? I'm using the default example for shape detection included with Rev3.0 EmguCV.

推荐答案

  1. 首先查找边缘(例如,参见Sobel运算符或Canny)
  2. 找到轮廓,之后轮廓将代表圆形
  3. 按区域过滤轮廓
  4. 对每个轮廓使用minEnclosingCircle以获取中心和 半径.
  1. Find edges first (see Sobel operator or Canny for example)
  2. Find contours, after that contours will represent circles
  3. Filter contours by area
  4. Use minEnclosingCircle for each contour to get center and radius.

这篇关于检测图像中的圆圈的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆