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

InvWCxy.h

Go to the documentation of this file.
00001 #ifndef Impala_Core_Array_InvWCxy_h
00002 #define Impala_Core_Array_InvWCxy_h
00003 
00004 #include <vector>
00005 #include "Core/Array/Arrays.h"
00006 #include "Core/Array/InvCompDer.h"
00007 #include "Core/Array/Rgb2Ooo.h"
00008 #include "Core/Array/Add.h"
00009 #include "Core/Array/Sub.h"
00010 #include "Core/Array/Div.h"
00011 #include "Core/Array/Norm2Sqr.h"
00012 #include "Core/Array/Pattern/PatM9N4PixOp.h"
00013 #include "Core/Array/Trait/M9N4poCxy.h"
00014 
00015 namespace Impala
00016 {
00017 namespace Core
00018 {
00019 namespace Array
00020 {
00021 
00022 
00023 /*
00024 input is an rgb image output is a list of:
00025 - gradient (Ex*Ex + Ey*Ey)
00026 - Wx
00027 - W 45
00028 - Wy
00029 - W 135
00030 - Clx
00031 - Cl 45
00032 - Cly
00033 - Cl 135
00034 - Cllx
00035 - Cll 45
00036 - Clly
00037 - Cll 135
00038 
00039 perhaps it would be better to return gradient through another parameter??
00040 */
00041 
00042 inline std::vector<Array2dScalarReal64*>
00043 //InvWiccest(Array2dVec3UInt8* rgb, double derivativeSigma)
00044 InvWCxy(Array2dVec3UInt8* rgb, double derivativeSigma)
00045 {
00046     std::vector<Array2dScalarReal64*> result;
00047     result.resize(13);
00048     for(int i=0 ; i<13 ; ++i)
00049         result[i] = new Array2dScalarReal64(rgb->CW(), rgb->CH(), rgb->BW(),
00050                                             rgb->BH());
00051 
00052     // convert to ooo
00053     Array2dVec3Real64* ooo = new Array2dVec3Real64(rgb->mCW, rgb->mCH, 0, 0);
00054     Rgb2Ooo(ooo, rgb);
00055     std::vector<Array2dScalarReal64*> listDer = InvCompDer(ooo, derivativeSigma,
00056                                                                3);
00057     delete ooo;
00058 
00059     // compute Wx and Wy
00060     Div(result[1], listDer[1], listDer[0]);
00061     Div(result[3], listDer[2], listDer[0]);
00062 
00063     // compute {Cl,Cll}{x,y}
00064     Trait::M9N4poCxy<Array2dScalarReal64, Array2dScalarReal64> mnpoConFeat;
00065     Pattern::PatM9N4PixOp(result[5], result[7], result[9], result[11],
00066                           listDer[0], listDer[1], listDer[2],
00067                           listDer[3], listDer[4], listDer[5],
00068                           listDer[6], listDer[7], listDer[8], mnpoConFeat);
00069 
00070     // compute the rest
00071     Norm2Sqr(result[0], listDer[1], listDer[2]); //gradient
00072     Add(result[ 2], result[1], result[3]); //W 45
00073     Sub(result[ 4], result[1], result[3]); //W 135
00074     Add(result[ 6], result[5], result[7]); //Cl 45
00075     Sub(result[ 8], result[5], result[7]); //Cl 135
00076     Add(result[10], result[9], result[11]); //Cll 45
00077     Sub(result[12], result[9], result[11]); //Cll 135
00078 
00079     for(i=0 ; i<listDer.size() ; i++)
00080         delete listDer[i];
00081 
00082     return result;
00083 }
00084 
00085 } // namespace Array
00086 } // namespace Core
00087 } // namespace Impala
00088 
00089 #endif

Generated on Fri Mar 19 09:30:47 2010 for ImpalaSrc by  doxygen 1.5.1