Skip to content
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion ADApp/pluginSrc/NDPluginProcess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ void NDPluginProcess::processCallbacks(NDArray *pArray)
}
if (enableFilter) {
getIntegerParam(NDPluginProcessNumFilter, &numFilter);
if (numFilter < 1) numFilter = 1;
getDoubleParam (NDPluginProcessOOffset, &oOffset);
getDoubleParam (NDPluginProcessOScale, &oScale);
getDoubleParam (NDPluginProcessOC1, &oc1);
Expand Down Expand Up @@ -235,7 +236,7 @@ void NDPluginProcess::processCallbacks(NDArray *pArray)
this->pNDArrayPool->convert(pScratch, &pArrayOut, (NDDataType_t)dataType);
}

if (autoOffsetScale && (NULL != pArrayOut)) {
if (autoOffsetScale && (NULL != pArrayOut) && (maxValue > minValue)) {
pArrayOut->getInfo(&arrayInfo);
double maxScale = pow(2., arrayInfo.bytesPerElement*8) - 1;
scale = maxScale /(maxValue-minValue);
Expand Down
1 change: 1 addition & 0 deletions ADApp/pluginSrc/NDPluginStats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ asynStatus NDPluginStats::doComputeHistogramT(NDArray *pArray, NDStats_t *pStats

pArray->getInfo(&arrayInfo);
nElements = arrayInfo.nElements;
if (pStats->histMax <= pStats->histMin) pStats->histMax = pStats->histMin + 1;
scale = (pStats->histSize - 1) / (pStats->histMax - pStats->histMin);

pStats->histBelow = 0;
Expand Down
Loading