[英]Whats the reason for passing a math.pi (pi number) in the hough function?
我不知道在 hough 函数中传递阈值数字的原因
cv.HoughLines(src, lines, 1, Math.PI / 180, 30, 0, 0, 0);
Based on OpenCV's documentation here :基于此处的OpenCV 文档:
HoughLines(InputArray image, OutputArray lines, double rho, double theta, int threshold, double srn=0, double stn=0 )
the fourth parameter is theta
which refers to:第四个参数是
theta
,它指的是:
theta – Angle resolution of the accumulator in radians .
theta – 以弧度为单位的累加器的角度分辨率。
In order to convert d
degrees to radians, you should multiply d
by Math.Pi
and divide it by 180. In your example, the angle resolution is set to 1 degree or Math.Pi / 180
radians.为了将
d
度转换为弧度,您应该将d
乘以Math.Pi
并将其除以 180。在您的示例中,角度分辨率设置为1 度或Math.Pi / 180
弧度。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.