简体   繁体   中英

scipy.signal.bspline in python ,filter or interpolate?

I got this problem when I'm reading the code for face recognition,and what I'm sure about is this function is not a interpolation function, the interpolation function about Bspline is from package scipy.interpolate,which should be written as

spline = interpolate.BSpline(t, c, k, extrapolate=False)

this is for sure..The souce use of scipy.signal.bspline is like this. from scipy import signal

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

And I cannot understand the source code of scipy.signal.bspline ,all I can know from the souce code is that this function may be a filter.And I wanna konw what is the realationship between the input and output when you put input array into the fuction scipy.signal.bspline.I'm not very interested in how this function works, I just wanna know the characteristic of this function's result.Thank you very much.

The following can be read from the documentation , which is pretty self-explanatory.

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM