Image Processing Reference
In-Depth Information
steps of one: 1 , 2 , 3 , 4 , 5 ,..., 1040 , 1041 , 1042. What comes after the summation is
a function, which is controlled by i and it is the values of this function (for each i )
that are added together. Below, some examples of different summations are given:
12
i
=
1
+
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
=
78
(B.4)
i
=
1
4
2
ยท
i
=
0
+
2
+
4
+
6
+
8
=
20
(B.5)
i
=
0
1
i 2
=
4
+
1
+
0
+
1
=
6
(B.6)
i
=โ
2
Say that you want to sum the pixel values of the first row in an image with width
=
200. This is then written as
199
f(i, 0 )
(B.7)
i
=
0
In general the summation is written as
m
h(i)
(B.8)
i
=
n
In terms of C-programming the summation is implemented as a for-loop :
Result =0;
for
(i = n;
i < (m+1);
i = i+1)
{
Result
=
Result
+ h( i );
}
We can also do a summation using more indices than i . For example, if we want to
add all pixel values in an image, then we need two indices representing rows and
columns. Concretely we would write
M
โ
1
N
โ
1
f(i,j)
(B.9)
j
=
0
i
=
0
where N is the number of columns and M is the number of rows. In terms of C-
programming the double summation is implemented as two for-loops :
Search WWH ::

Custom Search