NumCpp  2.12.1
A Templatized Header Only C++ Implementation of the Python NumPy Library
nc::imageProcessing Namespace Reference

Data Structures

class  Centroid
 holds the information for a centroid More...
 
class  Cluster
 Holds the information for a cluster of pixels. More...
 
class  ClusterMaker
 Clusters exceedance data into contiguous groups. More...
 
class  Pixel
 Holds the information for a single pixel. More...
 

Functions

template<typename dtype >
NdArray< bool > applyThreshold (const NdArray< dtype > &inImageArray, dtype inThreshold)
 
template<typename dtype >
std::vector< Centroid< dtype > > centroidClusters (const std::vector< Cluster< dtype > > &inClusters)
 
template<typename dtype >
std::vector< Cluster< dtype > > clusterPixels (const NdArray< dtype > &inImageArray, const NdArray< bool > &inExceedances, uint8 inBorderWidth=0)
 
template<typename dtype >
std::vector< Centroid< dtype > > generateCentroids (const NdArray< dtype > &inImageArray, double inRate, const std::string &inWindowType, uint8 inBorderWidth=0)
 
template<typename dtype >
dtype generateThreshold (const NdArray< dtype > &inImageArray, double inRate)
 
NdArray< bool > windowExceedances (const NdArray< bool > &inExceedances, uint8 inBorderWidth) noexcept
 

Function Documentation

◆ applyThreshold()

template<typename dtype >
NdArray< bool > nc::imageProcessing::applyThreshold ( const NdArray< dtype > &  inImageArray,
dtype  inThreshold 
)

Applies a threshold to an image

Parameters
inImageArray
inThreshold
Returns
NdArray of booleans of pixels that exceeded the threshold

◆ centroidClusters()

template<typename dtype >
std::vector< Centroid< dtype > > nc::imageProcessing::centroidClusters ( const std::vector< Cluster< dtype > > &  inClusters)

Center of Mass centroids clusters

Parameters
inClusters
Returns
std::vector<Centroid>

◆ clusterPixels()

template<typename dtype >
std::vector< Cluster< dtype > > nc::imageProcessing::clusterPixels ( const NdArray< dtype > &  inImageArray,
const NdArray< bool > &  inExceedances,
uint8  inBorderWidth = 0 
)

Clusters exceedance pixels from an image

Parameters
inImageArray
inExceedances
inBorderWidthborder to apply around exceedance pixels post clustering (default 0)
Returns
std::vector<Cluster>

◆ generateCentroids()

template<typename dtype >
std::vector< Centroid< dtype > > nc::imageProcessing::generateCentroids ( const NdArray< dtype > &  inImageArray,
double  inRate,
const std::string &  inWindowType,
uint8  inBorderWidth = 0 
)

Generates a list of centroids givin an input exceedance rate

Parameters
inImageArray
inRateexceedance rate
inWindowType(string "pre", or "post" for where to apply the exceedance windowing)
inBorderWidthborder to apply (default 0)
Returns
std::vector<Centroid>

◆ generateThreshold()

template<typename dtype >
dtype nc::imageProcessing::generateThreshold ( const NdArray< dtype > &  inImageArray,
double  inRate 
)

Calculates a threshold such that the input rate of pixels exceeds the threshold. Really should only be used for integer input array values. If using floating point data, user beware...

Parameters
inImageArray
inRate
Returns
dtype

◆ windowExceedances()

NdArray< bool > nc::imageProcessing::windowExceedances ( const NdArray< bool > &  inExceedances,
uint8  inBorderWidth 
)
inlinenoexcept

Window expand around exceedance pixels

Parameters
inExceedances
inBorderWidth
Returns
NdArray<bool>