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