14 #ifndef _UTIL_DECONV_H_
15 #define _UTIL_DECONV_H_
49 static void Divergence(num *DivV,
int DivWidth,
int DivHeight,
50 const numvec2 *V,
int Width,
int Height,
int NumChannels)
54 for(k = 0; k < NumChannels; k++)
57 DivV[0] = V[0].
x + V[0].
y;
60 for(x = 1; x < Width - 1; x++)
61 DivV[x] = V[x].x - V[x - 1].x + V[x].y;
68 for(y = 1; y < Height - 1; y++, DivV += DivWidth, V += Width)
71 DivV[0] = V[0].
x + V[0].y - V[-Width].y;
74 for(x = 1; x < Width - 1; x++)
75 DivV[x] = V[x].x - V[x - 1].x
76 + V[x].y - V[x - Width].y;
79 DivV[x] = V[x].y - V[x - Width].y;
86 for(x = 1; x < Width - 1; x++)
87 DivV[x] = V[x].x - V[x - 1].x;
91 DivV += ((long)DivWidth)*((long)DivHeight - Height + 1);
106 const int Width = S->
Width;
107 const int Height = S->
Height;
110 const long PadJump = ((long)PadWidth) * (PadHeight - Height);
115 for(y = 0; y < Height; y++, u += Width, B += PadWidth)
116 for(x = 0; x < Width; x++)
119 num Diff = unew - u[x];
124 return (num)sqrt(Norm) / S->
fNorm;