Detecting Circles within an image

依然范特西╮ 提交于 2019-12-12 03:19:44

问题


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);

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:


  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.


来源:https://stackoverflow.com/questions/34190594/detecting-circles-within-an-image

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!