CImgStats
Syntax
CImage::CImgStats
Type
class
Required Headers
CImage.h
Namespace
arc
Remarks
This class is returned from the GetStats method and contains the calculated statistics data. Access to the statistics data is through the following public class members:

CLASS MEMBER TYPE DESCRIPTION
gMin double Minumum pixel value
gMax double Maximum pixel value
gTotalPixels double Total pixel count
gMean double Mean pixel value ( { sum of pixels } / { total pixel count } )
gVariance double Variance ( { 1 / { total pixels } } * sum{ { pixel - { pixel mean } }^2 } )
gStdDev double Standard deviation ( sqrt{ variance } )
gSaturatedPixCnt double Total number of saturated pixels ( >= 2^16 for 16-bit images; >= 2^32 for 32-bit images )

Example
        // This code demonstrates how to print out the min/max
        // pixel value for an image.

        #include <iostream>
        #include "CController.h"
        #include "CImage.h"

        using namespace std;
        using namespace arc;

        int main()
        {
            try {
                CController cController;
                CImage cImg;
     
                // ....
                //
                // Take an image, which will reside in the kernel
                // image buffer ( cController.mapFd )
                //
                // ....

                //
                // Assumes a 512x600 pixel image was taken and resides
                // in the kernel image buffer ( cController.mapFd )
                //
                CImage::CImgStats cImgStats = cImg.GetStats( cController.mapFd,
                                                             512,
                                                             600 );

                cout << "Image min: " << cImgStats.gMin << endl
                     << "Image max: " << cImgStats.gMax << endl
                     << "Image mean: " << cImgStats.gMean << endl
                     << "Image total pixels: " << cImgStats.gTotalPixels
                     << endl;
            }
            catch ( std::exception &e )
            {
                cerr << "Exception Occurred: " << e.what() << endl;
            }
        }

© Astronomical Research Cameras, Inc.