 |
NumCpp
2.1.0
A C++ implementation of the Python Numpy library
|
Go to the documentation of this file.
47 template<
typename dtype>
59 double rowCenter = 0.0;
60 double colCenter = 0.0;
66 const auto pixelValue =
static_cast<double>(inArray(row, col));
69 rowCenter += pixelValue *
static_cast<double>(row);
70 colCenter += pixelValue *
static_cast<double>(col);
77 return { rowCenter, colCenter };
90 returnArray(0, colIdx) +=
static_cast<double>(inArray(rowIdx, colIdx)) *
static_cast<double>(rowIdx);
93 returnArray(0, colIdx) /= inten[colIdx];
109 returnArray(0, rowIdx) +=
static_cast<double>(inArray(rowIdx, colIdx)) *
static_cast<double>(colIdx);
112 returnArray(0, rowIdx) /= inten[rowIdx];
Shape shape() const noexcept
Definition: NdArrayCore.hpp:4312
#define STATIC_ASSERT_ARITHMETIC(dtype)
Definition: StaticAsserts.hpp:38
Shape shape(const NdArray< dtype > &inArray) noexcept
Definition: Functions/Shape.hpp:45
std::uint32_t uint32
Definition: Types.hpp:41
A Shape Class for NdArrays.
Definition: Core/Shape.hpp:41
uint32 cols
Definition: Core/Shape.hpp:46
NdArray< dtype > sum(Axis inAxis=Axis::NONE) const
Definition: NdArrayCore.hpp:4427
Axis
Enum To describe an axis.
Definition: Types.hpp:47
NdArray< dtype > & zeros() noexcept
Definition: NdArrayCore.hpp:4626
Definition: Coordinate.hpp:45
uint32 rows
Definition: Core/Shape.hpp:45
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition: Error.hpp:37
NdArray< double > centerOfMass(const NdArray< dtype > &inArray, Axis inAxis=Axis::NONE)
Definition: centerOfMass.hpp:48