 |
NumCpp
2.4.0
A Templatized Header Only C++ Implementation of the Python NumPy Library
|
Go to the documentation of this file.
42 namespace imageProcessing
47 template<
typename dtype>
51 STATIC_ASSERT_ARITHMETIC(dtype);
70 centerOfMass(inCluster);
80 double row() const noexcept
92 double col() const noexcept
116 double eod() const noexcept
158 return row_ == rhs.row_ && col_ == rhs.col_ && intensity_ == rhs.intensity_ && eod_ == rhs.eod_;
173 return !(*
this == rhs);
191 return intensity_ < rhs.intensity_ ? false :
true;
205 inStream << inCentriod.
str();
213 dtype intensity_{ 0 };
225 void centerOfMass(
const Cluster<dtype>& inCluster)
227 const Shape clusterShape(inCluster.height(), inCluster.width());
228 NdArray<dtype> clusterArray(clusterShape);
229 clusterArray.zeros();
231 const uint32 rowMin = inCluster.rowMin();
232 const uint32 colMin = inCluster.colMin();
234 for (
auto& pixel : inCluster)
236 clusterArray(pixel.row - rowMin, pixel.col - colMin) = pixel.intensity;
240 row_ = rowCol.front() + rowMin;
241 col_ = rowCol.back() + colMin;
bool operator!=(const Centroid< dtype > &rhs) const noexcept
Definition: Centroid.hpp:171
dtype intensity() const noexcept
Definition: Centroid.hpp:104
std::string num2str(dtype inNumber)
Definition: num2str.hpp:46
std::string str() const
Definition: Centroid.hpp:128
Centroid(const Cluster< dtype > &inCluster)
Definition: Centroid.hpp:66
bool operator==(const Centroid< dtype > &rhs) const noexcept
Definition: Centroid.hpp:156
std::uint32_t uint32
Definition: Types.hpp:40
double eod() const noexcept
Definition: Centroid.hpp:116
bool operator<(const Centroid< dtype > &rhs) const noexcept
Definition: Centroid.hpp:189
double col() const noexcept
Definition: Centroid.hpp:92
double row() const noexcept
Definition: Centroid.hpp:80
friend std::ostream & operator<<(std::ostream &inStream, const Centroid< dtype > &inCentriod)
Definition: Centroid.hpp:203
Definition: Coordinate.hpp:44
void print() const
Definition: Centroid.hpp:141
holds the information for a centroid
Definition: Centroid.hpp:48
Holds the information for a cluster of pixels.
Definition: Cluster.hpp:53
NdArray< double > centerOfMass(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: centerOfMass.hpp:47