cornsea

hough 变换和噪声

#!/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()

posted on 2010-12-24 09:53  cornsea  阅读(302)  评论(0编辑  收藏  举报

导航