NumCpp
2.1.0
A C++ implementation of the Python Numpy library
centroidClusters.hpp
Go to the documentation of this file.
1
30
#pragma once
31
32
#include "
NumCpp/Core/Internal/StaticAsserts.hpp
"
33
#include "
NumCpp/ImageProcessing/Centroid.hpp
"
34
#include "
NumCpp/ImageProcessing/Cluster.hpp
"
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
{
54
STATIC_ASSERT_ARITHMETIC
(dtype);
55
56
std::vector<Centroid<dtype>> centroids;
57
58
centroids.reserve(inClusters.size());
59
for
(
auto
& cluster : inClusters)
60
{
61
centroids.emplace_back(cluster);
62
}
63
64
return
centroids;
65
}
66
}
// namespace imageProcessing
67
}
// namespace nc
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::Cluster
Holds the information for a cluster of pixels.
Definition:
Cluster.hpp:54
include
NumCpp
ImageProcessing
centroidClusters.hpp
Generated by
1.8.17