15 #ifndef __IPSDKMATH_EXTREMAUTILS_H__ 16 #define __IPSDKMATH_EXTREMAUTILS_H__ 20 #include <boost/bind.hpp> 21 #include <boost/function.hpp> 38 std::vector<IndexType>& extremaIdxColl);
51 std::vector<IndexType>& extremaIdxColl)
69 std::vector<IndexType>& extremaIdxColl)
94 const T& dilateFactor,
103 template <
typename T,
109 std::vector<IndexType>& extremaIdxColl);
117 template <
typename T,
122 std::vector<IndexType>& extremaIdxColl)
133 template <
typename T,
138 std::vector<IndexType>& extremaIdxColl)
185 template <
typename ExtremaInfo,
190 const T extremaThresholdValue,
191 boost::function<
void (
const ExtremaInfo&,
ipReal64&, T&)> extractExtremaCoordsWrapper,
192 std::vector<ExtremaInfo>& extremaInfoColl);
196 template <
typename T,
200 const IndexType& dataIdx,
204 extremaLocation =
static_cast<ipReal64>(dataIdx);
205 extremaValue = inputColl[dataIdx];
214 template <
typename T>
232 template <
typename T,
237 std::vector<IndexType>& extremaInfoColl)
240 typedef void (*ExtractExtremaCoordsFun) (
const std::vector<T>&,
const IndexType&,
ipReal64&, T&);
241 typedef boost::function<void (const IndexType&, ipReal64&, T&)> ExtractExtremaCoordsWrapper;
242 ExtractExtremaCoordsWrapper extractExtremaCoordsWrapper = boost::bind(static_cast<ExtractExtremaCoordsFun>(extractBasicExtremaCoords<T>), boost::cref(inputColl), _1, _2, _3);
244 extractExtremaCoordsWrapper, extremaInfoColl);
260 template <
typename T,
265 const T extremaThresholdValue,
266 std::vector<IndexType>& extremaInfoColl)
268 typedef void (*ExtractExtremaCoordsFun) (
const std::vector<T>&,
const IndexType&,
ipReal64&, T&);
269 typedef boost::function<void (const IndexType&, ipReal64&, T&)> ExtractExtremaCoordsWrapper;
270 ExtractExtremaCoordsWrapper extractExtremaCoordsWrapper = boost::bind(static_cast<ExtractExtremaCoordsFun>(extractBasicExtremaCoords<T>), boost::cref(inputColl), _1, _2, _3);
272 extractExtremaCoordsWrapper, extremaInfoColl);
286 template <
typename T,
291 std::vector<IndexType>& extremaInfoColl)
294 typedef void (*ExtractExtremaCoordsFun) (
const std::vector<T>&,
const IndexType&,
ipReal64&, T&);
295 typedef boost::function<void (const IndexType&, ipReal64&, T&)> ExtractExtremaCoordsWrapper;
296 ExtractExtremaCoordsWrapper extractExtremaCoordsWrapper = boost::bind(static_cast<ExtractExtremaCoordsFun>(extractBasicExtremaCoords<T>), boost::cref(inputColl), _1, _2, _3);
298 extractExtremaCoordsWrapper, extremaInfoColl);
314 template <
typename T,
319 const T extremaThresholdValue,
320 std::vector<IndexType>& extremaInfoColl)
322 typedef void (*ExtractExtremaCoordsFun) (
const std::vector<T>&,
const IndexType&,
ipReal64&, T&);
323 typedef boost::function<void (const IndexType&, ipReal64&, T&)> ExtractExtremaCoordsWrapper;
324 ExtractExtremaCoordsWrapper extractExtremaCoordsWrapper = boost::bind(static_cast<ExtractExtremaCoordsFun>(extractBasicExtremaCoords<T>), boost::cref(inputColl), _1, _2, _3);
326 extractExtremaCoordsWrapper, extremaInfoColl);
335 #endif // __IPSDKMATH_EXTREMAUTILS_H__ Definition of import/export macro for library.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
Minima extrema.
Definition: ExtremaTypes.h:34
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Definition: NumericLimits.h:27
IPSDKMATH_API void filterExtrema(const eExtremaType &extremaType, const ipReal64 minDistance, const T extremaThresholdValue, boost::function< void(const ExtremaInfo &, ipReal64 &, T &)> extractExtremaCoordsWrapper, std::vector< ExtremaInfo > &extremaInfoColl)
function allowing to filter a collection of extrema using a distance criterion
void extractBasicExtremaCoords(const std::vector< T > &inputColl, const IndexType &dataIdx, ipReal64 &extremaLocation, T &extremaValue)
Definition: ExtremaUtils.h:199
#define IPSDKMATH_API
Import/Export macro for library IPSDKMath.
Definition: IPSDKMathExports.h:27
std::pair< ipUInt64, ipUInt64 > ExtremaRange
index for dilated local extrema
Definition: ExtremaTypes.h:55
void filterMaxima(const std::vector< T > &inputColl, const ipReal64 minDistance, std::vector< IndexType > &extremaInfoColl)
function allowing to filter a collection of maxima using a distance criterion Extrema are first sorte...
Definition: ExtremaUtils.h:289
void filterMinima(const std::vector< T > &inputColl, const ipReal64 minDistance, std::vector< IndexType > &extremaInfoColl)
function allowing to filter a collection of minima using a distance criterion Extrema are first sorte...
Definition: ExtremaUtils.h:235
IPSDKMATH_API void findLocalDilatedExtrema(const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, const eExtremaType &extremaType, const T &dilateFactor, ExtremaRangeColl &extremaRangeColl)
generic function allowing to search for local 'dilated' extrema into a collection of values ...
void findLocalMaxima(const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, std::vector< IndexType > &extremaIdxColl)
function allowing to search for local maxima into a collection of values
Definition: ExtremaUtils.h:136
void findLocalMinima(const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, std::vector< IndexType > &extremaIdxColl)
function allowing to search for local minima into a collection of values
Definition: ExtremaUtils.h:120
eExtremaType
Enumerate allowing to define an extrema type.
Definition: ExtremaTypes.h:32
Predefined types for extrema management.
IPSDKMATH_API void findLocalExtrema(const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, const eExtremaType &extremaType, std::vector< IndexType > &extremaIdxColl)
function allowing to search for local extrema into a collection of values (this is the non strict ext...
void findLocalStrictMaxima(const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, std::vector< IndexType > &extremaIdxColl)
generic function allowing to search for local strict maxima into a collection of values ...
Definition: ExtremaUtils.h:67
IPSDKMATH_API void findLocalStrictExtrema(const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, const eExtremaType &extremaType, std::vector< IndexType > &extremaIdxColl)
generic function allowing to search for local strict extrema into a collection of values ...
Maxima extrema.
Definition: ExtremaTypes.h:36
std::vector< ExtremaRange > ExtremaRangeColl
collection of indexes for dilated local extrema
Definition: ExtremaTypes.h:64
void findLocalStrictMinima(const std::vector< T > &inputColl, const eExtremaBorderPolicy &extremaBorderPolicy, std::vector< IndexType > &extremaIdxColl)
generic function allowing to search for local strict minima into a collection of values ...
Definition: ExtremaUtils.h:49
eExtremaBorderPolicy
Enumerate allowing to describe border policy used during extrema extraction processing.
Definition: ExtremaTypes.h:45