Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion ADApp/pluginSrc/NDPluginStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,15 @@ void NDPluginStats::processCallbacks(NDArray *pArray)
size_t bgdPixels;
int bgdWidth;
int dim;
NDStats_t stats, *pStats=&stats, statsTemp, *pStatsTemp=&statsTemp;
// Value-initialise both stats structs. NDStats_t is a POD with no
// constructor, and several fields (sigmaXY, skewX/Y, kurtosisX/Y,
// eccentricity, orientation) are assigned only inside the M00 > 0 block of
// doComputeCentroid. A dark or below-threshold frame (M00 == 0), or
// ComputeCentroid disabled, leaves them unwritten while they are copied
// unconditionally into the broadcast time-series array and the _RBV
// parameters below. Zero-init makes an unassigned field read as 0 instead
// of stack garbage.
NDStats_t stats={}, *pStats=&stats, statsTemp={}, *pStatsTemp=&statsTemp;
double bgdCounts, avgBgd;
NDArray *pBgdArray=NULL;
int computeStatistics, computeCentroid, computeProfiles, computeHistogram;
Expand Down
Loading