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

2024-05-15 00:36:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我不知道在hough函数中为阈值传递一个数字的原因

cv.HoughLines(src, lines, 1, Math.PI / 180, 30, 0, 0, 0);

Tags: 函数srcpi原因阈值数字mathcv
1条回答
网友
1楼 · 发布于 2024-05-15 00:36:50

根据OpenCV的文档here

HoughLines(InputArray image, OutputArray lines, double rho, double theta, int threshold, double srn=0, double stn=0 )

第四个参数是theta,它表示:

theta – Angle resolution of the accumulator in radians.

为了将d度转换为弧度,您应该将d乘以Math.Pi再除以180。在您的示例中,角度分辨率设置为1度Math.Pi / 180弧度

相关问题 更多 >

    热门问题