Home || Architecture || Video Search || Visual Search || Scripts || Applications || Important Messages || OGL || Src

UpoRGB2Ooo.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_Trait_UpoRGB2Ooo_h
00002 #define Impala_Core_Array_Trait_UpoRGB2Ooo_h
00003 
00004 namespace Impala
00005 {
00006 namespace Core
00007 {
00008 namespace Array
00009 {
00010 namespace Trait
00011 {
00012 
00013 
00014 template<class StorT>
00015 class UpoRGB2OooPtr
00016 {
00017 public:
00018     typedef Pattern::TagTransInVar TransVarianceCategory;
00019     typedef Pattern::TagCallPointer CallCategory;
00020 
00021     UpoRGB2OooPtr()
00022     {
00023     }
00024 
00025     void DoIt(double *ooo, StorT* rgb)
00026     {
00027         // Gaussian opponent
00028         ooo[0] = 255.0*(rgb[0] * 0.000233846 + rgb[1] * 0.00261968 + rgb[2] * 0.00127135);
00029         ooo[1] = 255.0*(rgb[0] * 0.000726333 + rgb[1] * 0.000718106+ rgb[2] * -0.00121377);
00030         ooo[2] = 255.0*(rgb[0] * 0.000846833 + rgb[1] * -0.00173932+ rgb[2] * 0.000221515);
00031 /*
00032         // RGB opponent:
00033         ooo[0] = ((double)(rgb[0]+rgb[1]+rgb[2]))/3.0;
00034         ooo[1] = ((double)(rgb[0]+rgb[1]-2*rgb[2]))/4.0;
00035         ooo[2] = ((double)(rgb[0]-2*rgb[1]+rgb[2]))/4.0;
00036  original:
00037         ooo[1] = ((double)rgb[1]-rgb[0])/2.0;
00038         ooo[2] = ((double)rgb[0]+rgb[1]-2*rgb[2])/4.0;
00039 
00040         ooo[2] = ((double)rgb[0]-2*rgb[1]+rgb[2])/4.0;
00041 */    
00042     }
00043 };
00044 
00045 } // namespace Trait
00046 } // namespace Array
00047 } // namespace Core
00048 } // namespace Impala
00049 
00050 #endif //UpoRGB2Ooo_h

Generated on Fri Mar 19 09:31:02 2010 for ImpalaSrc by  doxygen 1.5.1