This section includes information for using the pure Python API of bob.sp.
Extrapolates the values in src to dst with zeros.
Input src (and dst) arrays can be 1 or 2-dimensional. For more details, read the help for extrapolate().
Parameters:
Returns None, raises in case of errors.
Extrapolates the values in src to dst, mirroring src.
Input src (and dst) arrays can be 1 or 2-dimensional. For more details, read the help for extrapolate().
Parameters:
Returns None, raises in case of errors.
Extrapolates the values in src to dst, with nearest values.
Input src (and dst) arrays can be 1 or 2-dimensional. For more details, read the help for extrapolate().
Parameters:
Returns None, raises in case of errors.
Extrapolates the values in src to dst, with a constant value.
Input src (and dst) arrays can be 1 or 2-dimensional. For more details, read the help for extrapolate().
Parameters:
Returns None, raises in case of errors.
Extrapolates the values in src to dst, using circular extrapolation.
Input src (and dst) arrays can be 1 or 2-dimensional. For more details, read the help for extrapolate().
Parameters:
Returns None, raises in case of errors.
Bases: object
BorderType (C++ enumeration) - cannot be instantiated from Python
Use of the values available in this class as input for BorderType when required:
- Zero
- Constant
- NearestNeighbour
- Circular
- Mirror
A dictionary containing all names and values available for this enumeration is available through the attribute entries.
Bases: object
DCT1D(shape) -> new DCT1D operator
Calculates the direct DCT of a 1D array/signal. Input and output arrays are 1D NumPy arrays of type float64.
The length of the output vector
A tuple that represents the size of the output vector
Bases: object
DCT2D(shape) -> new DCT2D operator
Calculates the direct DCT of a 2D array/signal. Input and output arrays are 2D NumPy arrays of type float64.
The height of the output vector
A tuple that represents the size of the output vector
The width of the output vector
Bases: object
FFT1D(shape) -> new FFT1D operator
Calculates the direct FFT of a 1D array/signal. Input and output arrays are 1D NumPy arrays of type complex128.
The length of the output vector
A tuple that represents the size of the output vector
Bases: object
FFT2D(shape) -> new FFT2D operator
Calculates the direct FFT of a 2D array/signal. Input and output arrays are 2D NumPy arrays of type complex128.
The height of the output vector
A tuple that represents the size of the output vector
The width of the output vector
Bases: object
IDCT1D(shape) -> new IDCT1D operator
Calculates the inverse DCT of a 1D array/signal. Input and output arrays are 1D NumPy arrays of type float64.
The length of the output vector
A tuple that represents the size of the output vector
Bases: object
IDCT2D(shape) -> new IDCT2D operator
Calculates the inverse DCT of a 2D array/signal. Input and output arrays are 2D NumPy arrays of type float64.
The height of the output vector
A tuple that represents the size of the output vector
The width of the output vector
Bases: object
IFFT1D(shape) -> new IFFT1D operator
Calculates the inverse FFT of a 1D array/signal. Input and output arrays are 1D NumPy arrays of type complex128.
The length of the output vector
A tuple that represents the size of the output vector
Bases: object
IFFT2D(shape) -> new IFFT2D operator
Calculates the inverse FFT of a 2D array/signal. Input and output arrays are 2D NumPy arrays of type complex128.
The height of the output vector
A tuple that represents the size of the output vector
The width of the output vector
Bases: object
Quantization(dtype, [rounding=False, [num_levels=-1, [min_level=None, [max_level=None]]]]) Quantization(quantization_table) Quantization(other)
Functor to quantize 1D or 2D signals into different number of levels. At the moment, only uint8 and uint16 data types are supported. The output array returned by this functor will always have a uint32 data type.
Parameters:
Once this object has been created, it can be used through its () operator, by passing input and output parameters:
(numpy.dtype) The data type of arrays that are going to be input by this functor. Currently supported values are uint8 and uint16.
(scalar) Input values higher than this value are scaled to this value prior to quantization. As a result, they will be scaled in the highest qunatization level. The data type of this scalar should be coercible to the datatype of the input.
Input values smaller than or equal to this value are scaled to this value prior to quantization. As a result, they will be scaled in the lowest quantization level. The data type of this scalar should be coercible to the datatype of the input.
(int) the number of quantization levels. The default is the total number of discrete values permitted by the data type. For example, uint8 allows for 256 levels.
Calculates the quantization level for a single input value, given the current threshold table.
(array) A 1-dimensional array matching the data type of input containing user-specified thresholds for the quantization. If Each element corresponds to the lower boundary of the particular quantization level. Eg. array([ 0, 5, 10]) means quantization in 3 levels. Input values in the range will be quantized to level 0, input values in the range will be quantized to level 1 and input values in the range will be quantized to level 2.
(str) Possible values of this parameter:
Computes the direct Discrete Cosine Transform of a 1D or 2D array/signal of type float64. Allocates a new output array if dst is not provided. If it is, then it must be of the same type and shape as src.
Parameters:
Returns a 1 or 2-dimensional array, of the same dimension as src, of type float64, containing the DCT of the input signal.
Extrapolates values in the given array using the specified border type. Works for 1 or 2D input arrays. The parameter value is only used if the border type is set to bob.sp.BorderSize.Constant. It is, by default, set to 0., or the equivalent on the datatype passed as input. For example, False, if the input is boolean and 0+0j, if it is complex.
Computes the direct Fast Fourier Transform of a 1D or 2D array/signal of type complex128. Allocates a new output array if dst is not provided. If it is, then it must be of the same type and shape as src.
Parameters:
Returns a 1 or 2-dimensional array, of the same dimension as src, of type complex128, containing the FFT of the input signal.
If a 1D complex128 array is passed, inverses the two halves of that array and returns the result as a new array. If a 2D complex128 array is passed, swaps the four quadrants of the array and returns the result as a new array.
Parameters:
src [array] A 1 or 2-dimensional array of type complex128 with the signal to be shifted.
dst [array, optional] A 1 or 2-dimensional array of type complex128 and matching dimensions to src in which the result of the operation will be stored.
Returns a 1 or 2-dimensional array, of the same dimension as src, of type complex128, containing the shifted version of theinput.
Computes the inverse Discrete Cosinte Transform of a 1D or 2D transform of type float64. Allocates a new output array if dst is not provided. If it is, then it must be of the same type and shape as src.
Parameters:
Returns a 1 or 2-dimensional array, of the same dimension as src, of type float64, containing the inverse DCT of the input transform.
Computes the inverse Fast Fourier Transform of a 1D or 2D transform of type complex128. Allocates a new output array if dst is not provided. If it is, then it must be of the same type and shape as src.
Parameters:
Returns a 1 or 2-dimensional array, of the same dimension as src, of type complex128, containing the inverse FFT of the input transform.
This method undoes what fftshift() does. It accepts 1 or 2-dimensional arrays of type complex128.
Parameters:
src [array] A 1 or 2-dimensional array of type complex128 with the signal to be shifted.
dst [array, optional] A 1 or 2-dimensional array of type complex128 and matching dimensions to src in which the result of the operation will be stored.
Returns a 1 or 2-dimensional array, of the same dimension as src, of type complex128, containing the shifted version of theinput.