NumCpp
2.4.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 "
NumCpp/Core/Internal/StaticAsserts.hpp
"
32
#include "
NumCpp/Core/Types.hpp
"
33
#include "
NumCpp/ImageProcessing/Cluster.hpp
"
34
#include "
NumCpp/ImageProcessing/ClusterMaker.hpp
"
35
#include "
NumCpp/NdArray.hpp
"
36
37
#include <vector>
38
39
namespace
nc
40
{
41
namespace
imageProcessing
42
{
43
//============================================================================
44
// Method Description:
53
template
<
typename
dtype>
54
std::vector<Cluster<dtype> >
clusterPixels
(
const
NdArray<dtype>
& inImageArray,
const
NdArray<bool>
& inExceedances,
uint8
inBorderWidth = 0)
55
{
56
STATIC_ASSERT_ARITHMETIC
(dtype);
57
58
ClusterMaker<dtype>
clusterMaker(&inExceedances, &inImageArray, inBorderWidth);
59
return
std::vector<Cluster<dtype> >(clusterMaker.
begin
(), clusterMaker.
end
());
60
}
61
}
// namespace imageProcessing
62
}
// namespace nc
StaticAsserts.hpp
nc::imageProcessing::clusterPixels
std::vector< Cluster< dtype > > clusterPixels(const NdArray< dtype > &inImageArray, const NdArray< bool > &inExceedances, uint8 inBorderWidth=0)
Definition:
clusterPixels.hpp:54
STATIC_ASSERT_ARITHMETIC
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition:
StaticAsserts.hpp:37
nc::uint8
std::uint8_t uint8
Definition:
Types.hpp:42
nc::NdArray< dtype >
NdArray.hpp
ClusterMaker.hpp
nc::imageProcessing::ClusterMaker::begin
const_iterator begin() const noexcept
Definition:
ClusterMaker.hpp:157
nc::imageProcessing::ClusterMaker
Clusters exceedance data into contiguous groups.
Definition:
ClusterMaker.hpp:52
nc
Definition:
Coordinate.hpp:44
Cluster.hpp
Types.hpp
nc::imageProcessing::ClusterMaker::end
const_iterator end() const noexcept
Definition:
ClusterMaker.hpp:169
include
NumCpp
ImageProcessing
clusterPixels.hpp
Generated by
1.8.17