我有三点:
(1,3) (2,4) (3,5)
哪个等式是:
y = x + 2
和它的
slope = 1
intercept = 2在Hough变换和绘图之后,
# Hough Transformin in my code
r_axis[i] = x_point * math.cos(th) + y_point * math.sin(th)我得到了:

这个阴谋告诉我:
r = 1
theta = 135 deg (???)但我的方程式y = x + 1告诉我
theta =
arctan(slope) ( -pi < tan < +pi ) =
45 deg答案应该是45度,而不是135度。
我很困惑
以下是我的源代码:
发布于 2020-02-23 15:26:46
好吧,在我几乎没想过之后。
图的交集是theta = 135 deg, r=1.414而不是theta = 135 deg, r=1。
我们将y = x + 2修改为y - x = 2
答案是:
r = 1.414
theta = 135 deg我们代替了
1.414 = y*sin (135 deg) - x*cos(135 deg)
=> 2 = y - x
=> y = x + 2所以,代码和绘图都没有问题。
https://stackoverflow.com/questions/60363025
复制相似问题