当我阅读人脸识别的代码时,我遇到了这个问题,我确定的是这个函数不是插值函数,关于B样条的插值函数来自scipy.interpolate软件包,应该写成
spline = interpolate.BSpline(t, c, k, extrapolate=False)
这是sure..The的源码,scipy.signal.bspline的用法是这样的。从scipy导入信号
def find_peak_start(input, treshold=0.001, peak_length=15):
input = numpy.abs(numpy.gradient(signal.bspline(input, 25)))
# Control parameters
input_treshold = numpy.nanmax(input) * treshold
input_length = input.shape[0]
recording = False
start_x = 0
stop_x = 0
# Walk from start to end. When the current value exceeds threshold,
# start recording.
for i in range(0, input_length):
if recording:
if input[i] > treshold:
stop_x = i
if (stop_x - start_x) > peak_length:
return start_x
else:
recording = False
else:
if input[i] > treshold:
start_x = i
recording = True
# Nothing found
return 0我不理解scipy.signal.bspline的源代码,从源代码中我所知道的就是这个函数可能是一个filter.And,我想知道当你把输入数组放入函数scipy.signal.bspline时,输入和输出之间的关系是什么,我对这个函数是如何工作的不是很感兴趣,我只想知道这个函数的result.Thank的特性。
发布于 2019-12-06 20:50:33
https://stackoverflow.com/questions/59176303
复制相似问题