NumCpp  2.9.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
centroidClusters.hpp
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include <utility>
32 #include <vector>
33 
37 
38 namespace nc
39 {
40  namespace imageProcessing
41  {
42  //============================================================================
43  // Method Description:
49  template<typename dtype>
50  std::vector<Centroid<dtype>> centroidClusters(const std::vector<Cluster<dtype>>& inClusters)
51  {
53 
54  std::vector<Centroid<dtype>> centroids;
55 
56  centroids.reserve(inClusters.size());
57  for (auto& cluster : inClusters)
58  {
59  centroids.emplace_back(cluster);
60  }
61 
62  return centroids;
63  }
64  } // namespace imageProcessing
65 } // namespace nc
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:37
Holds the information for a cluster of pixels.
Definition: Cluster.hpp:55
std::vector< Centroid< dtype > > centroidClusters(const std::vector< Cluster< dtype >> &inClusters)
Definition: centroidClusters.hpp:50
Definition: Coordinate.hpp:45