h, theta, d = transform.hough_line(outlines)
for acum, angle, dist in zip(*transform.hough_line_peaks(h, theta, d)):
y0 = (dist - 0 * np.cos(angle)) / np.sin(angle)
y1 = (dist - outlines.shape[1] * np.cos(angle)) / np.sin(angle)
x0 = ...
x1 = ...
rr,cc,_ = draw.line_aa(x0,y0,x1,y1)
我需要的是在我的轮廓形状范围内,即640,640(2D),
x0
和x1
的值。而且我想把y0
和y1
缩放到我的outline.shape
的大小。请保留HTML标记。