def _random_curve(self, nr_curves):
curves = []
for i in range(nr_curves-1):
curve = [(0,0)]
# exlcude the 0 and 255
_x = numpy.sort(random.sample(range(1, 255), 32))
_y = numpy.sort(random.sample(range(1, 255), 32))
#_x = numpy.sort(numpy.random.randint(1, 255, 2))
#_y = numpy.sort(numpy.random.randint(1, 255, 2))
# _x[0] and _x[1] can't be the same
curve.append((_x[0], _y[0]))
curve.append((_x[1], _y[1]))
curve.append((255,255))
curves.append(curve)
curves.append([(255,255)])
return curves
filter_api.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录