hough 变换和噪声
时间:2010-12-24 来源:cornsea
#!/usr/bin/python # # A demo for hough transformation # import numpy as np import matplotlib.pyplot as plt import math lt = np.arange(0,10,0.5) lx = (2.4-0.6*lt)/0.4 t=np.arange(0,np.pi,np.pi/20) fig = plt.figure(1) ax=fig.add_subplot(211) for i in lt: x=np.sin(t)*(2.4-0.6*i/10.0)/0.4+np.cos(t)*i ax.plot(t,x) ax=fig.add_subplot(212) for i in lt: x=np.sin(t)*(2.4-0.6*i/10.0+np.random.randint(0,10)/10.0)/0.4+np.cos(t)*i ax.plot(t,x) plt.show()
相关阅读 更多 +