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
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042 inline std::vector<Array2dScalarReal64*>
00043
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
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
00060 Div(result[1], listDer[1], listDer[0]);
00061 Div(result[3], listDer[2], listDer[0]);
00062
00063
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
00071 Norm2Sqr(result[0], listDer[1], listDer[2]);
00072 Add(result[ 2], result[1], result[3]);
00073 Sub(result[ 4], result[1], result[3]);
00074 Add(result[ 6], result[5], result[7]);
00075 Sub(result[ 8], result[5], result[7]);
00076 Add(result[10], result[9], result[11]);
00077 Sub(result[12], result[9], result[11]);
00078
00079 for(i=0 ; i<listDer.size() ; i++)
00080 delete listDer[i];
00081
00082 return result;
00083 }
00084
00085 }
00086 }
00087 }
00088
00089 #endif