开发者

opencv houghCircles ( .... ?PARAM1?, ?PARAM2?)

开发者 https://www.devze.com 2023-03-04 16:42 出处:网络
cvHoughCircles(Mat& image, vector<Vec3f&g开发者_如何学Got;& circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0)
cvHoughCircles(Mat& image, vector<Vec3f&g开发者_如何学Got;& circles, int method, double dp, double minDist, double param1=100, double param2=100, int minRadius=0, int maxRadius=0)

according to documentation:

param1 - The first method-specific parameter. in the case of CV_HOUGH_GRADIENT it is the higher threshold of the two passed to Canny() edge detector (the lower one will be twice smaller)

I really don't understand point of param1 and param2. I've tried plenty different values, but still no idea. Could anyone please explain them to me. Thanks


Currently, the only implemented method in cvHoughCircles() is CV_HOUGH_GRADIENT.

So,

param1 - refers to the edge threshold that will be used by the Canny edge detector (applied to a grayscale image). cvCanny() accepts two thresholds and is internally invoked by cvHoughCircles(). Therefore the higher (first) threshold is set to param1 (passed as argument into cvHoughCircles()) and the lower (second) threshold is set to half of this value.

param2- Is the value for accumulator threshold. This value is used in the accumulator plane that must be reached so that a line is retrieved.

I would recommend you to read this book, which is in my opinion the best one describing OpenCv.

I hope this helps.

0

精彩评论

暂无评论...
验证码 换一张
取 消