1234567891011121314151617181920212223242526272829303132333435363738 |
- #pragma once
- #include <vector>
- namespace graft_cv {
- const float EPS = 2.2204e-16f;
- void diff(std::vector<float> in, std::vector<float>& out);
- void vectorElementsProduct(std::vector<float> a, std::vector<float> b, std::vector<float>& out);
- void findIndicesLessThan(std::vector<float> in, float threshold, std::vector<int>& indices);
- void selectElementsFromIndices(std::vector<float> in, std::vector<int> indices, std::vector<float>& out);
- void selectElementsFromIndices(std::vector<int> in, std::vector<int> indices, std::vector<int>& out);
- void signVector(std::vector<float> in, std::vector<int>& out);
- void scalarProduct(float scalar, std::vector<float> in, std::vector<float>& out);
- /*
- Inputs
- x0: input signal
- extrema: 1 if maxima are desired, -1 if minima are desired
- includeEndpoints - If true the endpoints will be included as possible extrema otherwise they will not be included
- Output
- peakInds: Indices of peaks in x0
- */
- void findPeaks(std::vector<float> x0, std::vector<int>& peakInds, bool includeEndpoints = true, float extrema = 1);
- void indexPeaks(
- std::vector<float>&stem_width,
- std::vector<int>&peak_indices,
- float mu,
- std::vector<float>& peak_power);
-
-
- }
|