Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   Related Pages  

RWindowPcaOp.hpp

00001 #ifndef _RWindowPcaOp_H
00002 #define _RWindowPcaOp_H
00003 
00036 #include <stdio.h>
00037 
00038 #include "AnImage.hpp"
00039 #include "AbsRImageFilter.hpp"
00040 
00041 #include "RImage.hpp"           
00042 #include "Real3CImage.hpp"
00043 
00044 class RWindowPcaOp : public AbsRImageFilter
00045 {
00046 private:
00047 
00048 int                             width, height;
00049 
00050 int                             pcaChannel;                     // wanted PCA channel
00051 
00052 int                             nWindows;
00053 int                             widthW, heightW;                // Window size
00054 int                             nwW, nhW, dimensionW;
00055 
00056 double*                 meanSample;
00057 double*                 covariance;
00058 
00059 
00060 double*                 eigenValue;
00061 double*                 triDiagonalCov;
00062 double*                 eigenVectors;
00063 
00064 double*                 e;                              // temporary eigenvalue computation
00065 
00066 protected:
00067 
00068 void computeWindowCovariance(RImage* g);
00069 
00070 void triDiagonalisation();
00071 
00072 // Public householder tridiagonalisation in C
00073 void tri_diag(double* a,double* d,double* e,double* z,int n,double tol);
00074 int calc_eigenstructure(double* d,double* e,double* z,int n,double macheps);
00075 
00076 public:
00077 
00078 RWindowPcaOp(int widthWindow=8, int heightWindow=8, int pcaChannel=0);
00079 virtual ~RWindowPcaOp();
00080 
00081 // Default is principal component for each channel
00082 virtual RImage* filter(RImage* source, RImage* destination=0);
00083 
00084 // All channels recovered
00085 // virtual Real3CImage* singleFilter(AnImage* source, Real3CImage* destination);
00086 
00087 virtual void report(FILE* file){}
00088 virtual void report(){}
00089 };
00090 
00091 #endif
SourceForge.net Logo
Restoreinpaint sourceforge project `C++/Java Image Processing, Restoration, Inpainting Project'.

Bernard De Cuyper: Open Project Leader: Concept, design and development.
Bernard De Cuyper & Eddy Fraiha 2002, 2003. Bernard De Cuyper 2004. Open and free, for friendly usage only.
Modifications on Belgium ground of this piece of artistic work, by governement institutions or companies, must be notified to Bernard De Cuyper.
bern_bdc@hotmail.com