NumCpp  1.0
A C++ implementation of the Python Numpy library
centroidClusters.hpp
Go to the documentation of this file.
1 
30 #pragma once
31 
35 
36 #include <utility>
37 #include <vector>
38 
39 namespace nc
40 {
41  namespace imageProcessing
42  {
43  //============================================================================
44  // Method Description:
51  template<typename dtype>
52  std::vector<Centroid<dtype> > centroidClusters(const std::vector<Cluster<dtype> >& inClusters)
53  {
55 
56  std::vector<Centroid<dtype> > centroids;
57 
58  for (auto& cluster : inClusters)
59  {
60  centroids.push_back(std::move(Centroid<dtype>(cluster)));
61  }
62 
63  return centroids;
64  }
65  }
66 }
StaticAsserts.hpp
STATIC_ASSERT_ARITHMETIC
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:38
Centroid.hpp
nc::imageProcessing::centroidClusters
std::vector< Centroid< dtype > > centroidClusters(const std::vector< Cluster< dtype > > &inClusters)
Definition: centroidClusters.hpp:52
nc
Definition: Coordinate.hpp:45
Cluster.hpp
nc::imageProcessing::Centroid
holds the information for a centroid
Definition: Centroid.hpp:49
nc::imageProcessing::Cluster
Holds the information for a cluster of pixels.
Definition: Cluster.hpp:54