# Transformation Function: Gonzalez and Woods

I have been reading Image Processing from Gonzalez and Woods and in the chapter Image Transformation I have come across this equation

$$T \left(u, v\right) = \sum_{x=0}^{M-1} { \sum_{y=0}^{N-1} { f \left(x, y\right) \, r \left(x, y, u, v\right) } } \,.$$

I am unable to understand this mathematical notation. Any help will be highly appreciated. Thanks

Those $${\sum}\text{-signs}$$ specify sigma notation. They're basically like for loops where you keep summing up the value specified in the body.

The equation, $$T \left(u, v\right) = \sum_{x=0}^{M-1} { \sum_{y=0}^{N-1} { f \left(x, y\right) \, r \left(x, y, u, v\right) } } \,,$$

translates into:

public double T(double u, double v)
{
var sum = 0.0;

for (int x=0; x <= M-1; ++x)
{
for (int y=0; y <= N-1; ++y)
{
sum = sum + (f(x, y) * r(x, y, u, v));
}
}

return sum;
}


In other words, it defines some function, $$T \left(u, v\right) ,$$ that takes two input variables: $$u$$ and $$v .$$ You also need to know two other functions: $$f \left(x, y\right)$$ and $$r\left(x, y, u, v\right) ,$$ which means you'll need at least 2 more equations.

Then:

1. Start with a starting total value of $$0 .$$

2. Set $$x$$ to $$0 .$$

3. Set $$y$$ to $$0 .$$

4. Calculate $$f\left(x, y\right) r\left(x, y, u, v\right) ,$$ then add this value to the total.

• On the first evaluation, $$x=0$$ and $$y=0 ,$$ so that's $$f\left(0, 0\right) r\left(0, 0, u, v\right) .$$
5. Increment $$y .$$

• If it's still less-than-or-equal-to $$N - 1 ,$$ then go back to Step (4).
6. Increment $$x .$$

• If it's still less-than-or-equal-to $$M - 1 ,$$ then go back to Step (3).
7. The final total is the calculated value for $$T \left(u, v\right) .$$

• What is r(x,y,u,v) referring to? what are those extra parameters u and v? – Turing101 Dec 17 '19 at 13:42
• Are we multiplying each pixel intensity alone with that function? any explanation showing how this works on a matrix level by taking 2 matrices will be of much help – Turing101 Dec 17 '19 at 13:44
• @HIRAKMONDAL I'm not sure. The equation is very generic, so it's hard to guess what the variables might refer to without seeing the book. $u$ and $v$ may be coordinate positions for a pixel. You'll probably have to read where the book declares its notation to figure out what the symbols match up to. – Nat Dec 17 '19 at 13:49