how to detect circles and rectangle?

opencv中对圆检测的函数为:HoughCircles(src_gray,circles,CV_HOUGHT_GRADIENT,1,src_gray.cols/8,200,100,0,0)

circles:vector<Vec3f>

CV_HOUGHT_GRADIENT:指定检测算法,现在只有霍夫梯度算法

dp = 1:累加器图像的反比分辨率

src_gray.cols/8:检测到圆心之间的最小距离

200:Canny函数的高阈值

100:Canny函数的低阈值

0:能检测到的最小圆半径

0:能检测到的最大圆半径

用这个函数检测圆需要调节的参数很多,用多大阈值完全看经验。 

rect:

     http://www.pyimagesearch.com/2014/04/21/building-pokedex-python-finding-game-boy-screen-step-4-6/

circles:

   https://github.com/sol-prog/OpenCV-red-circle-detection/blob/master/circle_detect.cpp

  https://github.com/shayanc/Hough-transform-circle-detector/blob/master/circle_detection.cpp

  https://github.com/neodeng/SpotsDetect

  https://github.com/RomainQueraud/Cplusplus-CircleDetect

   https://github.com/ruteee/DetectAndGoCircles

   https://github.com/zhengsir/Visual_Circle_Detect

   https://github.com/night18/circle_shape_detect

  https://github.com/b--dub/OpenCV_MotionDetect_Circles

  

原文地址:https://www.cnblogs.com/573177885qq/p/7230727.html