histogram[stats.mode] = originalModeCount;
float[] hist = new float[256];
for (int i=0; i<256; i++)
hist[i] = stats.histogram[i];
FloatProcessor fp = new FloatProcessor(256, 1, hist, null);
GaussianBlur gb = new GaussianBlur();
gb.blur1Direction(fp, 2.0, 0.01, true, 0);
float maxCount=0f, sum=0f, mean, count;
int mode = 0;
for (int i=0; i<256; i++) {
count = hist[i];
sum += count;