Commit 0593a98a authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum

[STYLE]

parent 6db6a1e1
......@@ -22,6 +22,7 @@
//
//---------------------------------------------------------------------------
#include <algorithm>
#include <cstring> // memset()
#include <numeric>
#include <utility>
......
......@@ -22,6 +22,7 @@
//
//---------------------------------------------------------------------------
#include <vector>
#include <string>
#include "../../kernel/WKernel.h"
......@@ -161,6 +162,8 @@ void WMHistogramEqualization::moduleMain()
bool foundU = false;
size_t curI = 0;
size_t maxI = hist->size() - 1; // the largest index in hist
// search the histogram until the bucket with needed accumulative value is found
while ( curI <= maxI )
{
accumL += ( *hist )[ curI ];
......@@ -216,7 +219,9 @@ void WMHistogramEqualization::moduleMain()
{
double cdfVI = cdf[ hist->getIndexForValue( valueSet->getScalarDouble( vi ) ) ];
newData[ vi ] = static_cast< unsigned char >( 255.0 * ( cdfVI - cdfMin ) / ( double( valueSet->rawSize() ) - cdfMin ) );
newData[ vi ] = static_cast< unsigned char >(
255.0 * ( cdfVI - cdfMin ) / ( static_cast< double >( valueSet->rawSize() ) - cdfMin )
);
}
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment