Changeset 12052 for trunk


Ignore:
Timestamp:
09/08/11 22:36:56 (13 years ago)
Author:
tbretz
Message:
Fixed calculation of rms (variance)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/gui/BasicGlCamera.cc

    r12012 r12052  
    361361    {
    362362        ostringstream str;
    363         float min, max, mean, rms, median;
     363        float min, max, median;
    364364        min = max = fData[0];
    365         mean = 0;
    366         rms = 0;
     365        double mean = 0;
     366        double rms = 0;
    367367        median = 0;
    368368        multiset<double> medianSet;
     
    377377            medianSet.insert(fData[i]);
    378378        }
     379
    379380        mean /= ACTUAL_NUM_PIXELS;
    380         rms /= ACTUAL_NUM_PIXELS;
    381         rms = sqrt(rms);
    382 //        cout << "Size of the set: " << medianSet.size() << endl;
     381        rms = sqrt(rms/ACTUAL_NUM_PIXELS - sum * sum);
     382
    383383        multiset<double>::iterator it = medianSet.begin();
    384384        for (int i=0;i<(ACTUAL_NUM_PIXELS/2)-1;i++)
Note: See TracChangeset for help on using the changeset viewer.