NumCpp  2.8.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
clusterPixels.hpp
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include <vector>
32 
34 #include "NumCpp/Core/Types.hpp"
37 #include "NumCpp/NdArray.hpp"
38 
39 namespace nc
40 {
41  namespace imageProcessing
42  {
43  //============================================================================
44  // Method Description:
52  template<typename dtype>
53  std::vector<Cluster<dtype>> clusterPixels(const NdArray<dtype>& inImageArray,
54  const NdArray<bool>& inExceedances,
55  uint8 inBorderWidth = 0)
56  {
58 
59  ClusterMaker<dtype> clusterMaker(&inExceedances, &inImageArray, inBorderWidth);
60  return std::vector<Cluster<dtype>>(clusterMaker.begin(), clusterMaker.end());
61  }
62  } // namespace imageProcessing
63 } // namespace nc
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition: NdArrayCore.hpp:72
Clusters exceedance data into contiguous groups.
Definition: ClusterMaker.hpp:53
const_iterator begin() const noexcept
Definition: ClusterMaker.hpp:152
const_iterator end() const noexcept
Definition: ClusterMaker.hpp:163
std::vector< Cluster< dtype > > clusterPixels(const NdArray< dtype > &inImageArray, const NdArray< bool > &inExceedances, uint8 inBorderWidth=0)
Definition: clusterPixels.hpp:53
Definition: Coordinate.hpp:45
std::uint8_t uint8
Definition: Types.hpp:42