简体   繁体   English

在 hough 函数中传递 math.pi(pi 数)的原因是什么?

[英]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.

相关问题 为什么python中math.pi函数调用后没有括号? - Why are there no parentheses after math.pi function call in python? 如何避免 math.sin(math.pi*2*VERY LARGE NUMBER) 的误差幅度比 math.sin(math.pi*2) 大得多? - How to avoid math.sin(math.pi*2*VERY LARGE NUMBER) having a much larger error margin than math.sin(math.pi*2)? pygame中math.pi无法正常工作 - math.pi not working as expected in pygame 在 Python 中查找最多 n 位小数的数字。 另外,python 中的 math.pi 可靠吗? - Finding a number up to n decimal places in Python. Also, is math.pi from python reliable? 如何使用math.pi计算格雷戈里级数和误差 - How to calculate Gregory series and the error with math.pi 我应该使用scipy.pi,numpy.pi还是math.pi? - Should I use scipy.pi, numpy.pi, or math.pi? 为什么在python中使用math.sin(math.pi)会出错? - why am I getting an error using math.sin(math.pi) in python? 为什么在Python中用小写形式编写math.pi和math.e常量? - Why math.pi and math.e constants are written in lowercase in Python? Python:为什么cmath.exp(1j * math.pi)给出的答案是-1 + 1.2246063538223773e-16j,而不仅仅是-1 - Python: Why cmath.exp(1j*math.pi) gives the answer -1+1.2246063538223773e-16j but not simply -1 将数字 pi 转换为字符串“pi” - convert number pi into string "pi"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM