CWO++library  0.32
 All Classes Functions Variables Groups
Functions
Stastics

Functions

unsigned int CWO::Count (float a)
unsigned int CWO::CountNonZero ()
virtual float CWO::Average ()
 calculate the average of the real part
float CWO::Average (int m, int n, int Sx, int Sy)
virtual float CWO::Variance ()
 calculate the variance of the real part
float CWO::Variance (int m, int n, int Sx, int Sy)
float CWO::StdDev (int m, int n, int Sx, int Sy)
 calculate the standard deviation
virtual void CWO::__MaxMin (cwoComplex *a, float *max, float *min, int *max_x=nullptr, int *max_y=nullptr, int *min_x=nullptr, int *min_y=nullptr)
float CWO::Max (int *m=NULL, int *n=NULL)
 find maximum of the real part
float CWO::Min (int *m=NULL, int *n=NULL)
 find minimum of the real part
int CWO::MaxMin (float *max, float *min, int *max_x=nullptr, int *max_y=nullptr, int *min_x=nullptr, int *min_y=nullptr)
 find maxmum and minimum of the real part
void CWO::VarianceMap (int sx, int sy)
 generate variance map
float CWO::Histogram (int *hist, int N)
 generate histogram
virtual cwoComplex CWO::TotalSum ()
 Calculate total sum of real part.

Detailed Description


Function Documentation

virtual float CWO::Average ( )
virtual

calculate the average of the real part

Parameters:
m: coordinate of Region of Interest(ROI)
n: coordinate of ROI
Sx: ROI size
Sy: ROI size
Returns:
average

Reimplemented in GWO.

virtual float CWO::Variance ( )
virtual

calculate the variance of the real part

Returns:
variance

Reimplemented in GWO.

float CWO::StdDev ( int  m,
int  n,
int  Sx,
int  Sy 
)

calculate the standard deviation

Returns:
standard deviation
float CWO::Max ( int *  m = NULL,
int *  n = NULL 
)

find maximum of the real part

Returns:
maximum
float CWO::Min ( int *  m = NULL,
int *  n = NULL 
)

find minimum of the real part

Returns:
minimum
int CWO::MaxMin ( float *  max,
float *  min,
int *  max_x = nullptr,
int *  max_y = nullptr,
int *  min_x = nullptr,
int *  min_y = nullptr 
)

find maxmum and minimum of the real part

   @param *max pointer to maxmim value
   @param *min pointer to minimum value
   @param *max_x pointer to maxmim value
   @param *max_y pointer to minimum value
   @param *min_x pointer to the location of maxmim value
   @param *min_y pointer to the location of minimum value
   @return reserved
float max,min;
CWO a;
a.Load("test.bmp");
a.MaxMin(&max,&min); //you can find max and min velues at the same time
printf("max=%e min=%e\n",max,min);
void CWO::VarianceMap ( int  sx,
int  sy 
)

generate variance map

Parameters:
sx
sy
Note:
VAriance map is useful for detecting in-focus reconstructed planes from a hologram.
Conor P. McElhinney, John B. McDonald, Albertina Castro, Yann Frauel, Bahram Javidi, and Thomas J. Naughton, "Depth-independent segmentation of macroscopic three-dimensional objects encoded in single perspectives of digital holograms," Opt. Lett. 32, 1229-1231 (2007)
float CWO::Histogram ( int *  hist,
int  N 
)

generate histogram

   @param hist  pointer to frequency whose buffer is required to prepare by myself  
   @param N  bin number 
   @return  bin width. 
//sample code of generating kinoform.
int N=256, hist[256];
CWO a;
a.Load("test.bmp");
float bin_width=a.Histogram(hist,N);
virtual cwoComplex CWO::TotalSum ( )
virtual

Calculate total sum of real part.

Returns:
Total sum

Reimplemented in GWO.